From a87b1afe2abe597da96355fddf50a8c6c45746b6 Mon Sep 17 00:00:00 2001 From: Taso Date: Thu, 5 Aug 2021 18:09:11 -0400 Subject: [PATCH] fix(ci/pre-release): hopefully fix pre-release build --- .github/workflows/prerelease.yml | 22 +++++++++++++++------- .github/workflows/tagged-releases.yml | 2 +- package.json | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 750437c..07b2e0e 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -4,7 +4,7 @@ on: branches: - master jobs: - tagged-release: + pre-release-build: runs-on: ubuntu-latest outputs: @@ -18,8 +18,11 @@ jobs: fetch-depth: 0 ref: ${{ github.ref }} - name: Get variables - run: echo ::set-output name=VERSION_TAG::${GITHUB_REF/refs\/tags\//} 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)" @@ -38,14 +41,19 @@ jobs: run: yarn --frozen-lockfile - name: Run build run: npm run build - - name: Create Release + - 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 - files: | - - id: auto_release - + 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 diff --git a/.github/workflows/tagged-releases.yml b/.github/workflows/tagged-releases.yml index d5991e1..2311647 100644 --- a/.github/workflows/tagged-releases.yml +++ b/.github/workflows/tagged-releases.yml @@ -60,11 +60,11 @@ jobs: echo "Cleaned up" - name: Create Release uses: "marvinpinto/action-automatic-releases@latest" + id: auto_release with: repo_token: "${{ secrets.GITHUB_TOKEN }}" prerelease: false files: | "npwd-${{ steps.get_vars.outputs.VERSION_TAG }}" - id: auto_release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/package.json b/package.json index 3e93e67..581e990 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "pretty-quick": "^3.1.0" }, "scripts": { - "build": "lerna run test && CI=false lerna run build", + "build": "lerna run test && lerna run build", "prepare": "husky install", "bootstrap": "lerna bootstrap", "format:staged": "pretty-quick --staged",