From 95c3aea1d997e5b2740877f7d361474d2289cc7b Mon Sep 17 00:00:00 2001 From: Taso Date: Thu, 5 Aug 2021 19:33:01 -0400 Subject: [PATCH] ci(pre-release): cleaned up pre-release ci slightly --- .github/workflows/prerelease.yml | 41 +++++++++++++++----------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 3bce88d..66a3d09 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -5,56 +5,53 @@ on: - ci-testing jobs: pre-release-build: + name: 'Build & Create Pre-Release' 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: Setup Node and Yarn Cache + uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'yarn' + # Get zip util + - name: Install archive tools + run: sudo apt install zip + - 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 + + - name: Install Deps run: yarn --frozen-lockfile + - name: Run build - run: npm run build + run: yarn 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" + uses: "marvinpinto/action-automatic-releases@v1.2.1" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" title: Pre-Release Build (${{ steps.get_vars.outputs.SHORT_SHA }}) | ${{ steps.get_vars.outputs.DATE }} prerelease: true automatic_release_tag: "unstable" files: ./temp/npwd-pre-${{ steps.get_vars.outputs.SHORT_SHA }}.zip + env: CI: false GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file