From e6387248111fe35696b5375fb6ace41fc91eceeb Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Tue, 7 Jan 2025 17:48:35 +0000 Subject: [PATCH] Use artifacts for building binaries in CI --- .forgejo/workflows/publish.yml | 21 ++++++++++++++++----- .forgejo/workflows/staging.yml | 10 ++++++---- 2 files changed, 22 insertions(+), 9 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 ee0ede2..2e786f2 100644 --- a/.forgejo/workflows/staging.yml +++ b/.forgejo/workflows/staging.yml @@ -23,7 +23,7 @@ jobs: - run: yarn test - run: yarn lint - rsync: + package: needs: build runs-on: node steps: @@ -31,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