name: Prerelease Publisher on: push: branches: - master jobs: pre-release-build: runs-on: ubuntu-latest outputs: VERSION_TAG: ${{ steps.get_vars.outputs.VERSION_TAG }} steps: - name: Install archive tools run: sudo apt-get install zip gzip tar - name: Checkout source code uses: actions/checkout@v2 with: fetch-depth: 0 ref: ${{ github.ref }} - name: Get variables id: get_vars run: | echo ::set-output name=VERSION_TAG::${GITHUB_REF/refs\/tags\//} echo ::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" echo ::set-output name=DATE::$(date +'%D')" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - uses: actions/cache@v2 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - name: Use Node.js uses: actions/setup-node@v2 with: node-version: '14.x' - name: Install dependencies run: yarn --frozen-lockfile - name: Run build run: npm run build - name: Bundle and Zip files run: | mkdir -p ./temp/npwd/resources cp ./{LICENSE,README.md,config.json,import.sql,fxmanifest.lua} ./temp/npwd/ cp -r ./resources/{dist,html} ./temp/npwd/resources cd ./temp && zip -r npwd-pre-${{ steps.get_vars.outputs.SHORT_SHA }}.zip ./npwd - name: Create Release & Changelog uses: "marvinpinto/action-automatic-releases@latest" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" title: "Pre-Release Build | ${{ steps.get_vars.outputs.DATE }}" prerelease: true automatic_release_tag: "latest" files: ./temp/npwd-pre-${{ steps.get_vars.outputs.SHORT_SHA }}.zip env: CI: false GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}