From c7d879c8ccd0948cf2fc1edff61770e73593e9d2 Mon Sep 17 00:00:00 2001 From: aleidk Date: Wed, 23 Oct 2024 16:18:46 -0300 Subject: [PATCH] update workflows --- .forgejo/workflows/publish.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/publish.yaml b/.forgejo/workflows/publish.yaml index a8e7009..b31783a 100644 --- a/.forgejo/workflows/publish.yaml +++ b/.forgejo/workflows/publish.yaml @@ -2,6 +2,8 @@ name: Publish package on: push: workflow_dispatch: +env: + NPM_TAG: ${{ github.ref == 'refs/heads/main' && 'latest' || 'next' }} # Variables reference: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#about-contexts jobs: @@ -14,6 +16,7 @@ jobs: fetch-depth: 0 - name: Cache Bun dependencies + id: cache uses: actions/cache@v4 with: path: ~/.bun/install/cache @@ -22,12 +25,17 @@ jobs: ${{ runner.os }}-bun- - name: Setup Bun + id: "setup_bun" uses: oven-sh/setup-bun@v2 - - name: Install Dependencies - run: bun install - - - name: Push to registry + - name: Publish to registry + id: "publish" env: NPM_REGISTRY_TOKEN: ${{ secrets.NPM_TOKEN_FORGEJO }} - run: bun publish + run: bun publish --production --frozen-lockfile --tag ${{ env.NPM_TAG }} + + - name: Summary + run: | + echo "Bun executable chache found:\t${{ steps.setup_bun.outputs.cache-hit }}"; + echo "Bun dependencies chache found:\t${{ steps.cache.outputs.cache-hit }}"; + echo "Package published:\t${{ steps.publish.outcome }}";