diff --git a/.github/workflows/cloudflare-web-deploy.yml b/.github/workflows/cloudflare-web-deploy.yml index d3d2c4461..14d65c869 100644 --- a/.github/workflows/cloudflare-web-deploy.yml +++ b/.github/workflows/cloudflare-web-deploy.yml @@ -52,6 +52,13 @@ jobs: with: persist-credentials: false + - name: Resolve release version + id: version + shell: bash + run: | + TAG="${{ github.event_name == 'workflow_dispatch' && inputs.git_tag || github.ref_name }}" + echo "version=${TAG#v}" >> "$GITHUB_OUTPUT" + - name: Prepare OpenTofu deployment uses: ./.github/actions/prepare-tofu with: @@ -59,7 +66,7 @@ jobs: env: VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }} VITE_SENTRY_ENVIRONMENT: production - VITE_APP_VERSION: ${{ github.ref_name }} + VITE_APP_VERSION: ${{ steps.version.outputs.version }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} SENTRY_ORG: ${{ secrets.SENTRY_ORG }} SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} @@ -85,6 +92,13 @@ jobs: persist-credentials: false ref: ${{ github.event_name == 'workflow_dispatch' && inputs.git_tag || '' }} + - name: Resolve release version + id: version + shell: bash + run: | + TAG="${{ github.event_name == 'workflow_dispatch' && inputs.git_tag || github.ref_name }}" + echo "version=${TAG#v}" >> "$GITHUB_OUTPUT" + - name: Prepare OpenTofu deployment uses: ./.github/actions/prepare-tofu with: @@ -92,7 +106,7 @@ jobs: env: VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }} VITE_SENTRY_ENVIRONMENT: production - VITE_APP_VERSION: ${{ github.ref_name }} + VITE_APP_VERSION: ${{ steps.version.outputs.version }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} SENTRY_ORG: ${{ secrets.SENTRY_ORG }} SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} diff --git a/.github/workflows/cloudflare-web-dev.yml b/.github/workflows/cloudflare-web-dev.yml index 0b8f90075..746b860e3 100644 --- a/.github/workflows/cloudflare-web-dev.yml +++ b/.github/workflows/cloudflare-web-dev.yml @@ -41,14 +41,21 @@ jobs: with: persist-credentials: false + - name: Compute nightly version + id: version + shell: bash + run: | + VERSION="$(node .github/scripts/nightly-version.mjs "${{ github.run_number }}" "${{ github.run_attempt }}")" + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + - name: Prepare OpenTofu deployment uses: ./.github/actions/prepare-tofu with: - is_release_tag: 'false' + is_release_tag: 'true' env: VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }} VITE_SENTRY_ENVIRONMENT: development - VITE_APP_VERSION: ${{ github.ref_name }} + VITE_APP_VERSION: ${{ steps.version.outputs.version }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} SENTRY_ORG: ${{ secrets.SENTRY_ORG }} SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 0575b2d51..82d8d00c9 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -49,13 +49,17 @@ jobs: id: release_tag shell: bash run: | - if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + if [[ "${{ github.event_name }}" == "workflow_dispatch" && -n "${{ inputs.git_tag }}" ]]; then TAG="${{ inputs.git_tag }}" else TAG="${GITHUB_REF#refs/tags/}" fi if [[ "${TAG}" == v* ]]; then - echo "value=${TAG}" >> "$GITHUB_OUTPUT" + echo "value=${TAG#v}" >> "$GITHUB_OUTPUT" + echo "is_release=true" >> "$GITHUB_OUTPUT" + elif [[ "${GITHUB_REF}" == "refs/heads/dev" ]]; then + NIGHTLY_VERSION="$(node .github/scripts/nightly-version.mjs "${{ github.run_number }}" "${{ github.run_attempt }}")" + echo "value=${NIGHTLY_VERSION}" >> "$GITHUB_OUTPUT" echo "is_release=true" >> "$GITHUB_OUTPUT" else echo "value=" >> "$GITHUB_OUTPUT" @@ -90,6 +94,7 @@ jobs: - name: Build site env: VITE_BUILD_HASH: ${{ steps.vars.outputs.short_sha }} + VITE_APP_VERSION: ${{ steps.release_tag.outputs.value }} VITE_IS_RELEASE_TAG: ${{ steps.release_tag.outputs.is_release }} run: | NODE_OPTIONS=--max_old_space_size=4096 pnpm run build