From 448a2f8f11928e943d8e06b4bb909ccc1b6d0012 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Tue, 14 Jan 2025 18:31:43 +0000 Subject: [PATCH] Update build pipeline to upload artifacts for the binary (#256) # Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - Update the staging workflow to also test `release/*` branches - Move testing `hotfix/*` branches to the staging pipeline - Update the staging workflow to upload the built binaries to artifacts - Split the deploy workflow to package and upload the binaries to a separate stage to uploading to NPM #247, #248 ## Type of change Please delete options that are not relevant. - [x] New feature (non-breaking change which adds functionality) # How Has This Been Tested? Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration. - As this is a workflow change it will be tested once merged # Checklist - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that provde my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules Reviewed-on: https://git.vylpes.xyz/RabbitLabs/random-bunny/pulls/256 Reviewed-by: VylpesTester Co-authored-by: Ethan Lane Co-committed-by: Ethan Lane --- .forgejo/workflows/publish.yml | 21 ++++++++++++++++----- .forgejo/workflows/staging.yml | 12 ++++++++---- .forgejo/workflows/test.yml | 1 - 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.forgejo/workflows/publish.yml b/.forgejo/workflows/publish.yml index c9428ce..fee1e74 100644 --- a/.forgejo/workflows/publish.yml +++ b/.forgejo/workflows/publish.yml @@ -21,18 +21,29 @@ jobs: - run: yarn test - run: yarn lint - publish: + package: needs: build runs-on: node + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.x + - run: yarn package + - name: Upload Binary + uses: actions/upload-artifact@v4 + with: + path: bin/ + if-no-files-found: error + + publish: + needs: package + runs-on: node steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20.x - - run: yarn install --frozen-lockfile - - run: yarn build - - run: yarn package - - run: cp -r ./bin ${{ secrets.PROD_REPO_PATH }} - uses: https://github.com/JS-DevTools/npm-publish@v3 with: token: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.forgejo/workflows/staging.yml b/.forgejo/workflows/staging.yml index 94f3fce..2e786f2 100644 --- a/.forgejo/workflows/staging.yml +++ b/.forgejo/workflows/staging.yml @@ -4,6 +4,8 @@ on: push: branches: - develop + - release/* + - hotfix/* jobs: build: @@ -21,7 +23,7 @@ jobs: - run: yarn test - run: yarn lint - rsync: + package: needs: build runs-on: node steps: @@ -29,7 +31,9 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 20.x - - run: yarn install --frozen-lockfile - - run: yarn build - run: yarn package - - run: cp -r ./bin ${{ secrets.STAGE_REPO_PATH }} \ No newline at end of file + - name: Upload Binary + uses: actions/upload-artifact@v4 + with: + path: bin/ + if-no-files-found: error \ No newline at end of file diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index a70e410..9783ff4 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -4,7 +4,6 @@ on: push: branches: - feature/* - - hotfix/* - renovate/* - dependabot/*