From 7e533c42f8e2ef7813b5712c2a32e3dd7df87177 Mon Sep 17 00:00:00 2001 From: Jamil Date: Mon, 10 Jun 2024 10:47:49 -0600 Subject: [PATCH] refactor: Split releases for Clients and Gateways (#5287) - Removes version numbers from infra components (elixir/relay) - Removes version bumping from Rust workspace members that don't get published - Splits release publishing into `gateway-`, `headless-client-`, and `gui-client-` - Removes auto-deploying new infrastructure when a release is published. Use the Deploy Production workflow instead. Fixes #4397 --- .github/workflows/_build_artifacts.yml | 110 +++++++++---------- .github/workflows/_deploy_production.yml | 92 ++++++++-------- .github/workflows/_tauri.yml | 22 ++-- .github/workflows/_terraform.yml | 6 +- .github/workflows/cd.yml | 6 +- .github/workflows/ci.yml | 21 ++-- .github/workflows/{hotfix.yml => deploy.yml} | 4 +- .github/workflows/publish.yml | 48 ++++---- elixir/Dockerfile | 7 +- elixir/VERSION | 1 - elixir/apps/api/mix.exs | 4 +- elixir/apps/domain/mix.exs | 4 +- elixir/apps/web/mix.exs | 4 +- elixir/mix.exs | 6 +- elixir/sha.exs | 7 ++ kotlin/android/app/build.gradle.kts | 2 +- rust/Cargo.lock | 22 ++-- rust/connlib/clients/android/Cargo.toml | 2 +- rust/connlib/clients/apple/Cargo.toml | 2 +- rust/connlib/clients/shared/Cargo.toml | 3 +- rust/connlib/shared/Cargo.toml | 3 +- rust/connlib/snownet/Cargo.toml | 3 +- rust/connlib/tunnel/Cargo.toml | 3 +- rust/firezone-cli-utils/Cargo.toml | 3 +- rust/gateway/Cargo.toml | 2 +- rust/gui-client/src-tauri/Cargo.toml | 2 +- rust/headless-client/Cargo.toml | 2 +- rust/http-health-check/Cargo.toml | 3 +- rust/http-test-server/Cargo.toml | 3 +- rust/ip-packet/Cargo.toml | 3 +- rust/phoenix-channel/Cargo.toml | 3 +- rust/relay/Cargo.toml | 3 +- rust/snownet-tests/Cargo.toml | 3 +- scripts/Makefile | 73 +++++++----- website/redirects.js | 54 ++++----- 35 files changed, 276 insertions(+), 260 deletions(-) rename .github/workflows/{hotfix.yml => deploy.yml} (93%) delete mode 100644 elixir/VERSION create mode 100644 elixir/sha.exs diff --git a/.github/workflows/_build_artifacts.yml b/.github/workflows/_build_artifacts.yml index e950500ae..36901012f 100644 --- a/.github/workflows/_build_artifacts.yml +++ b/.github/workflows/_build_artifacts.yml @@ -3,10 +3,6 @@ run-name: Triggered from ${{ github.event_name }} by ${{ github.actor }} on: workflow_call: inputs: - tag_name: - description: "The tag name of the release" - required: true - type: string image_prefix: description: | The prefix to prepend to the image name to prevent SHA conflicts. @@ -38,15 +34,9 @@ on: description: "The gateway image that was built" value: ${{ jobs.data-plane.outputs.gateway_image }} -env: - # mark:automatic-version - VERSION: "1.0.6" - permissions: # write permission is required to create a github release contents: write - # autolabeler - pull-requests: write id-token: write jobs: @@ -61,18 +51,22 @@ jobs: target: runtime build-args: | APPLICATION_NAME=domain + GIT_SHA=${{ inputs.sha }} - image_name: api target: runtime build-args: | APPLICATION_NAME=api + GIT_SHA=${{ inputs.sha }} - image_name: web target: runtime build-args: | APPLICATION_NAME=web + GIT_SHA=${{ inputs.sha }} - image_name: elixir target: compiler build-args: | APPLICATION_NAME=api + GIT_SHA=${{ inputs.sha }} steps: - uses: actions/checkout@v4 with: @@ -97,7 +91,6 @@ jobs: ${{ steps.login.outputs.registry }}/firezone/${{matrix.image_name }} tags: | type=raw,value=${{ inputs.sha }} - type=raw,value=${{ env.VERSION }}-${{ inputs.sha }} - name: Sanitize github.ref_name run: | # `ref_name` contains `/`, '_' or '=' which is not a valid docker image tag @@ -119,8 +112,6 @@ jobs: push: true tags: | ${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_name }}:${{ inputs.sha }} - ${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_name }}:${{ env.VERSION }}-${{ inputs.sha }} - ${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_name }}:${{ env.VERSION }} ${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_name }}:${{ env.CACHE_TAG }} data-plane: @@ -161,12 +152,20 @@ jobs: - package: firezone-headless-client artifact: firezone-client-headless-linux image_name: client + # mark:next-headless-version + version: 1.0.6 + # mark:next-headless-version + release_name: headless-client-1.0.6 - package: firezone-relay artifact: firezone-relay image_name: relay - package: firezone-gateway artifact: firezone-gateway image_name: gateway + # mark:next-gateway-version + version: 1.0.6 + # mark:next-gateway-version + release_name: gateway-1.0.6 - package: snownet-tests artifact: snownet-tests image_name: snownet-tests @@ -174,8 +173,7 @@ jobs: artifact: http-test-server image_name: http-test-server env: - # mark:automatic-version - BINARY_DEST_PATH: ${{ matrix.name.artifact }}_1.0.6_${{ matrix.arch.shortname }} + BINARY_DEST_PATH: ${{ matrix.name.artifact }}_${{ matrix.name.version }}_${{ matrix.arch.shortname }} outputs: client_image: ${{ steps.image-name.outputs.client_image }} relay_image: ${{ steps.image-name.outputs.relay_image }} @@ -206,26 +204,19 @@ jobs: cross build $PROFILE -p ${{ matrix.name.package }} --target ${{ matrix.arch.target }} - # Used for release artifact - cp target/${{ matrix.arch.target }}/${{ inputs.profile }}/${{ matrix.name.package }} $BINARY_DEST_PATH - # Used for Docker images cp target/${{ matrix.arch.target }}/${{ inputs.profile }}/${{ matrix.name.package }} ${{ matrix.name.package }} - name: Upload Release Assets - if: ${{ inputs.profile == 'release' && matrix.stage == 'release' && (matrix.name.image_name == 'gateway' || matrix.name.image_name == 'client') }} + if: ${{ inputs.profile == 'release' && matrix.stage == 'release' && matrix.name.release_name }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -xe - # mark:automatic-version - if [ "${{ inputs.tag_name }}" != "1.0.6" ]; then - echo "Version mismatch between artifact and release. Have we bumped versions and rebased since the last release?" - exit 1 - fi - + # Used for release artifact + cp target/${{ matrix.arch.target }}/${{ inputs.profile }}/${{ matrix.name.package }} $BINARY_DEST_PATH sha256sum $BINARY_DEST_PATH > $BINARY_DEST_PATH.sha256sum.txt - gh release upload ${{ inputs.tag_name }} \ + gh release upload ${{ matrix.name.release_name }} \ ${{ env.BINARY_DEST_PATH }} \ ${{ env.BINARY_DEST_PATH }}.sha256sum.txt \ --clobber \ @@ -240,15 +231,15 @@ jobs: export_environment_variables: true create_credentials_file: true - name: Copy binaries to Google Cloud Storage - if: ${{ inputs.profile == 'release' && matrix.stage == 'release' && (matrix.name.image_name == 'gateway' || matrix.name.image_name == 'client') }} + if: ${{ inputs.profile == 'release' && matrix.stage == 'release' && contains(fromJSON('["relay", "gateway", "client"]'), matrix.name.image_name) }} run: | gcloud storage cp \ ${BINARY_DEST_PATH} \ - gs://firezone-staging-artifacts/${{ matrix.name.artifact }}/${{ env.VERSION }}-${{ inputs.sha }}/${{ matrix.arch.shortname }} + gs://firezone-staging-artifacts/firezone-${{ matrix.name.image_name }}/${{ inputs.sha }}/${{ matrix.arch.shortname }} gcloud storage cp \ ${BINARY_DEST_PATH}.sha256sum.txt \ - gs://firezone-staging-artifacts/${{ matrix.name.artifact }}/${{ env.VERSION }}-${{ inputs.sha }}/${{ matrix.arch.shortname }}.sha256sum.txt + gs://firezone-staging-artifacts/firezone-${{ matrix.name.image_name }}/${{ inputs.sha }}/${{ matrix.arch.shortname }}.sha256sum.txt - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx @@ -267,8 +258,9 @@ jobs: run: | set -xe - MAJOR_VERSION="${VERSION%%.*}" - MAJOR_MINOR_VERSION="${VERSION%.*}" + version="${{ matrix.name.version }}" + MAJOR_VERSION="${version%%.*}" + MAJOR_MINOR_VERSION="${version%.*}" echo "MAJOR_VERSION=${MAJOR_VERSION}" >> $GITHUB_ENV echo "MAJOR_MINOR_VERSION=${MAJOR_MINOR_VERSION}" >> $GITHUB_ENV - name: Docker meta @@ -277,13 +269,14 @@ jobs: with: images: ${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_prefix && format('{0}/', matrix.image_prefix) || '' }}${{ matrix.name.image_name }} + # We only version client and gateway tags: | type=raw,value=latest type=raw,value=${{ inputs.sha }} - type=raw,value=${{ env.VERSION }} - type=raw,value=${{ env.VERSION }}-${{ inputs.sha }} - type=raw,value=${{ env.MAJOR_VERSION }} - type=raw,value=${{ env.MAJOR_MINOR_VERSION }} + ${{ matrix.name.version && format('type=raw,value={0}', matrix.name.version) }} + ${{ matrix.name.version && format('type=raw,value={0}-{1}', matrix.name.version, inputs.sha) }} + ${{ matrix.name.version && format('type=raw,value={0}', env.MAJOR_VERSION) }} + ${{ matrix.name.version && format('type=raw,value={0}', env.MAJOR_MINOR_VERSION) }} - name: Sanitize github.ref_name run: | # `ref_name` contains `/`, '_' or '=' which is not a valid docker image tag @@ -327,7 +320,7 @@ jobs: run: echo "${{ matrix.name.image_name }}_image=${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_prefix && format('{0}/', matrix.image_prefix) || '' }}${{ matrix.name.image_name }}" >> $GITHUB_OUTPUT merge-docker-artifacts: - name: merge-${{ matrix.image_name }} + name: merge-${{ matrix.image.name }} needs: data-plane if: ${{ always() }} runs-on: ubuntu-22.04 @@ -340,15 +333,19 @@ jobs: # Exclude snownet-tests and http-test-server from perf image builds exclude: - - {image_prefix: perf, image_name: snownet-tests} - - {image_prefix: perf, image_name: http-test-server} + - {image_prefix: perf, image: {name: snownet-tests}} + - {image_prefix: perf, image: {name: http-test-server}} - image_name: - - relay - - gateway - - client - - snownet-tests - - http-test-server + image: + - name: relay + - name: gateway + # mark:next-gateway-version + version: 1.0.6 + - name: client + # mark:next-client-version + version: 1.0.6 + - name: snownet-tests + - name: http-test-server steps: - uses: actions/checkout@v4 with: @@ -360,9 +357,9 @@ jobs: - name: Download digests uses: actions/download-artifact@v4 with: - pattern: ${{ matrix.image_prefix && format('{0}-', matrix.image_prefix) || '' }}${{ matrix.image_name }}-${{ inputs.sha }}-digest-* + pattern: ${{ matrix.image_prefix && format('{0}-', matrix.image_prefix) || '' }}${{ matrix.image.name }}-${{ inputs.sha }}-digest-* merge-multiple: true - path: /tmp/digests/${{ matrix.image_name }} + path: /tmp/digests/${{ matrix.image.name }} - name: Display structure of downloaded artifacts run: ls -R /tmp/digests - name: Set up Docker Buildx @@ -370,9 +367,10 @@ jobs: - name: Build Version Tags run: | set -xe - MAJOR_VERSION="${VERSION%%.*}" - MAJOR_MINOR_VERSION="${VERSION%.*}" + version="${{ matrix.image.version }}" + MAJOR_VERSION="${version%%.*}" + MAJOR_MINOR_VERSION="${version%.*}" echo "MAJOR_VERSION=${MAJOR_VERSION}" >> $GITHUB_ENV echo "MAJOR_MINOR_VERSION=${MAJOR_MINOR_VERSION}" >> $GITHUB_ENV - name: Docker meta @@ -380,19 +378,19 @@ jobs: uses: docker/metadata-action@v5 with: images: - ${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_prefix && format('{0}/', matrix.image_prefix) || '' }}${{ matrix.image_name }} + ${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_prefix && format('{0}/', matrix.image_prefix) || '' }}${{ matrix.image.name }} tags: | type=raw,value=latest type=raw,value=${{ inputs.sha }} - type=raw,value=${{ env.VERSION }} - type=raw,value=${{ env.VERSION }}-${{ inputs.sha }} - type=raw,value=${{ env.MAJOR_VERSION }} - type=raw,value=${{ env.MAJOR_MINOR_VERSION }} + ${{ matrix.image.version && format('type=raw,value={0}', matrix.image.version) }} + ${{ matrix.image.version && format('type=raw,value={0}-{1}', matrix.image.version, inputs.sha) }} + ${{ matrix.image.version && format('type=raw,value={0}', env.MAJOR_VERSION) }} + ${{ matrix.image.version && format('type=raw,value={0}', env.MAJOR_MINOR_VERSION) }} - name: Create manifest list and push - working-directory: /tmp/digests/${{ matrix.image_name }} + working-directory: /tmp/digests/${{ matrix.image.name }} run: | tags=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") - sources=$(printf '${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_prefix && format('{0}/', matrix.image_prefix) || '' }}${{ matrix.image_name }}@sha256:%s ' *) + sources=$(printf '${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_prefix && format('{0}/', matrix.image_prefix) || '' }}${{ matrix.image.name }}@sha256:%s ' *) echo "$sources" docker buildx imagetools create $tags $sources - docker buildx imagetools inspect "${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_prefix && format('{0}/', matrix.image_prefix) || '' }}${{ matrix.image_name }}" + docker buildx imagetools inspect "${{ steps.login.outputs.registry }}/firezone/${{ matrix.image_prefix && format('{0}/', matrix.image_prefix) || '' }}${{ matrix.image.name }}" diff --git a/.github/workflows/_deploy_production.yml b/.github/workflows/_deploy_production.yml index badc76e24..8e0c35ba0 100644 --- a/.github/workflows/_deploy_production.yml +++ b/.github/workflows/_deploy_production.yml @@ -9,10 +9,6 @@ on: default: ${{ github.sha }} required: false -env: - # mark:automatic-version - VERSION: "1.0.6" - concurrency: group: "production-deploy" cancel-in-progress: false @@ -37,6 +33,10 @@ jobs: permissions: packages: write id-token: write + strategy: + fail-fast: false + matrix: + image: [domain, api, web, gateway, relay, client] steps: - uses: actions/checkout@v4 - name: Login to staging registry @@ -53,21 +53,11 @@ jobs: run: | set -xe - IMAGES=(domain api web gateway relay client) - MAJOR_VERSION="${VERSION%%.*}" - MAJOR_MINOR_VERSION="${VERSION%.*}" + SOURCE_TAG=${{ steps.login-staging.outputs.registry }}/firezone/${{ matrix.image }}:${{ inputs.tag }} - for image in "${IMAGES[@]}"; do - SOURCE_TAG=${{ steps.login-staging.outputs.registry }}/firezone/${image}:${{ inputs.tag }} - - docker buildx imagetools create \ - -t ${{ steps.login-production.outputs.registry }}/firezone/${image}:${{ inputs.tag }} \ - -t ${{ steps.login-production.outputs.registry }}/firezone/${image}:${{ env.VERSION }} \ - -t ${{ steps.login-production.outputs.registry }}/firezone/${image}:${{ env.VERSION }}-${{ inputs.tag }} \ - -t ${{ steps.login-production.outputs.registry }}/firezone/${image}:${MAJOR_VERSION} \ - -t ${{ steps.login-production.outputs.registry }}/firezone/${image}:${MAJOR_MINOR_VERSION} \ - $SOURCE_TAG - done + docker buildx imagetools create \ + -t ${{ steps.login-production.outputs.registry }}/firezone/${{ matrix.image }}:${{ inputs.tag }} \ + $SOURCE_TAG - name: Authenticate to Google Cloud id: auth uses: google-github-actions/auth@v2 @@ -77,42 +67,28 @@ jobs: export_environment_variables: true create_credentials_file: true - name: Copy Google Cloud Storage binaries to "latest" version + if: ${{ contains(fromJSON('["client", "relay", "gateway"]'), matrix.image) }} run: | set -xe - IMAGES=(firezone-gateway) ARCHITECTURES=(x86_64 aarch64 armv7) - MAJOR_VERSION="${VERSION%%.*}" - MAJOR_MINOR_VERSION="${VERSION%.*}" - - for image in "${IMAGES[@]}"; do - for arch in "${ARCHITECTURES[@]}"; do - # Copy sha256sum.txt - gcloud storage cp \ - gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.tag }}/${arch}.sha256sum.txt \ - gs://firezone-prod-artifacts/${image}/latest/${arch}.sha256sum.txt - - gcloud storage cp \ - gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.tag }}/${arch}.sha256sum.txt \ - gs://firezone-prod-artifacts/${image}/${{ env.VERSION }}/${arch}.sha256sum.txt + for arch in "${ARCHITECTURES[@]}"; do + # Copy sha256sum.txt gcloud storage cp \ - gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.tag }}/${arch}.sha256sum.txt \ - gs://firezone-prod-artifacts/${image}/${{ env.VERSION }}-${{ inputs.tag }}/${arch}.sha256sum.txt + gs://firezone-staging-artifacts/firezone-${{ matrix.image }}/${{ inputs.tag }}/${arch}.sha256sum.txt \ + gs://firezone-prod-artifacts/firezone-${{ matrix.image }}/latest/${arch}.sha256sum.txt + gcloud storage cp \ + gs://firezone-staging-artifacts/firezone-${{ matrix.image }}/${{ inputs.tag }}/${arch}.sha256sum.txt \ + gs://firezone-prod-artifacts/firezone-${{ matrix.image }}/${{ inputs.tag }}/${arch}.sha256sum.txt - # Copy binaries - gcloud storage cp \ - gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.tag }}/${arch} \ - gs://firezone-prod-artifacts/${image}/latest/${arch} - - gcloud storage cp \ - gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.tag }}/${arch} \ - gs://firezone-prod-artifacts/${image}/${{ env.VERSION }}/${arch} - - gcloud storage cp \ - gs://firezone-staging-artifacts/${image}/${{ env.VERSION }}-${{ inputs.tag }}/${arch} \ - gs://firezone-prod-artifacts/${image}/${{ env.VERSION }}-${{ inputs.tag }}/${arch} - done + # Copy binaries + gcloud storage cp \ + gs://firezone-staging-artifacts/firezone-${{ matrix.image }}/${{ inputs.tag }}/${arch} \ + gs://firezone-prod-artifacts/firezone-${{ matrix.image }}/latest/${arch} + gcloud storage cp \ + gs://firezone-staging-artifacts/firezone-${{ matrix.image }}/${{ inputs.tag }}/${arch} \ + gs://firezone-prod-artifacts/firezone-${{ matrix.image }}/${{ inputs.tag }}/${arch} done deploy-production: @@ -149,7 +125,7 @@ jobs: id: apply-run env: TF_VAR_image_tag: - '"${{ env.VERSION }}-${{ inputs.tag }}"' + '"${{ inputs.tag }}"' with: workspace: ${{ env.TF_WORKSPACE }} configuration_version: @@ -162,3 +138,23 @@ jobs: run: ${{ steps.apply-run.outputs.run_id }} comment: "Apply Run from GitHub Actions CI ${{ inputs.tag }}" + + update-vercel: + needs: deploy-production + runs-on: ubuntu-22.04 + env: + VERCEL_PROJECT: firezone + VERCEL_SLUG: firezone + # Fetched from Vercel's API. Not a secret. + VERCEL_ENV_VAR_ID: Ph436pR2So7nwrSI + steps: + - name: Update FIREZONE_DEPLOYED_SHA + run: | + curl -X PATCH "https://api.vercel.com/v9/projects/${VERCEL_PROJECT}/env/${ENV_VAR_ID}?slug=${VERCEL_SLUG}" \ + -H "Authorization: Bearer ${{ secrets.VERCEL_TOKEN }}" -H "Content-Type: application/json" \ + -d '{ + "comment": "latest deployed SHA for control plane", + "key": "FIREZONE_DEPLOYED_SHA", + "type": "plain", + "value": "${{ inputs.tag }}" + }' diff --git a/.github/workflows/_tauri.yml b/.github/workflows/_tauri.yml index 8d3f0402e..b7e42b3c3 100644 --- a/.github/workflows/_tauri.yml +++ b/.github/workflows/_tauri.yml @@ -12,10 +12,6 @@ permissions: contents: write id-token: write -env: - # mark:automatic-version - VERSION: "1.0.6" - defaults: run: working-directory: ./rust/gui-client @@ -29,22 +25,22 @@ jobs: matrix: include: - runs-on: ubuntu-20.04 - # mark:automatic-version + # mark:next-gui-version binary-dest-path: firezone-client-gui-linux_1.0.6_x86_64 rename-script: ../../scripts/build/tauri-rename-ubuntu.sh upload-script: ../../scripts/build/tauri-upload-ubuntu.sh - # mark:automatic-version + # mark:next-gui-version syms-artifact: rust/gui-client/firezone-client-gui-linux_1.0.6_x86_64.dwp - # mark:automatic-version + # mark:next-gui-version pkg-artifact: rust/gui-client/firezone-client-gui-linux_1.0.6_x86_64.deb - runs-on: windows-2019 - # mark:automatic-version + # mark:next-gui-version binary-dest-path: firezone-client-gui-windows_1.0.6_x86_64 rename-script: ../../scripts/build/tauri-rename-windows.sh upload-script: ../../scripts/build/tauri-upload-windows.sh - # mark:automatic-version + # mark:next-gui-version syms-artifact: rust/gui-client/firezone-client-gui-windows_1.0.6_x86_64.pdb - # mark:automatic-version + # mark:next-gui-version pkg-artifact: rust/gui-client/firezone-client-gui-windows_1.0.6_x86_64.msi env: BINARY_DEST_PATH: ${{ matrix.binary-dest-path }} @@ -81,7 +77,8 @@ jobs: - name: Sign the MSI if: ${{ runner.os == 'Windows' }} shell: bash - run: ../../scripts/build/sign.sh ../target/release/bundle/msi/Firezone_${{ env.VERSION }}_x64_en-US.msi + # mark:next-gui-version + run: ../../scripts/build/sign.sh ../target/release/bundle/msi/Firezone_1.0.6_x64_en-US.msi - name: Rename artifacts and compute SHA256 shell: bash run: ${{ matrix.rename-script }} @@ -105,6 +102,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} REPOSITORY: ${{ github.repository }} - TAG_NAME: ${{ env.VERSION }} + # mark:next-gui-version + TAG_NAME: 1.0.6 shell: bash run: ${{ matrix.upload-script }} diff --git a/.github/workflows/_terraform.yml b/.github/workflows/_terraform.yml index f822b50ab..23930819e 100644 --- a/.github/workflows/_terraform.yml +++ b/.github/workflows/_terraform.yml @@ -2,10 +2,6 @@ name: Terraform on: workflow_call: -env: - # mark:automatic-version - VERSION: "1.0.6" - jobs: plan-deploy: runs-on: ubuntu-22.04 @@ -48,7 +44,7 @@ jobs: uses: hashicorp/tfc-workflows-github/actions/create-run@v1.3.0 id: plan-run env: - TF_VAR_image_tag: '"${{ env.VERSION }}-${{ github.sha }}"' + TF_VAR_image_tag: '"${{ github.sha }}"' with: workspace: ${{ env.TF_WORKSPACE }} configuration_version: diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index dc4ace491..bf844ea06 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -12,10 +12,6 @@ on: branches: - main -env: - # mark:automatic-version - VERSION: "1.0.6" - jobs: # Builds images that match what's default in docker-compose.yml for # local development. @@ -75,7 +71,7 @@ jobs: uses: hashicorp/tfc-workflows-github/actions/create-run@v1.3.0 id: apply-run env: - TF_VAR_image_tag: '"${{ env.VERSION }}-${{ github.sha }}"' + TF_VAR_image_tag: '"${{ github.sha }}"' with: workspace: ${{ env.TF_WORKSPACE }} configuration_version: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7cb2596f..ceead6579 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,10 +13,6 @@ on: required: true type: string -env: - # mark:automatic-version - VERSION: "1.0.6" - # Cancel old workflow runs if new code is pushed concurrency: group: "ci-${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}" @@ -48,11 +44,21 @@ jobs: update-release-draft: runs-on: ubuntu-22.04 - outputs: - tag_name: ${{ steps.update-release-draft.outputs.tag_name }} + strategy: + fail-fast: false + matrix: + release_name: + # mark:next-gateway-version + - gateway-1.0.6 + # mark:next-headless-version + - headless-client-1.0.6 + # mark:next-gui-version + - gui-client-1.0.6 steps: - uses: release-drafter/release-drafter@v6 id: update-release-draft + with: + version: ${{ matrix.release_name }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -65,7 +71,6 @@ jobs: image_prefix: ${{ ((github.event_name == 'pull_request' || github.event_name == 'merge_group') && 'debug') || '' }} profile: ${{ inputs.profile || 'debug' }} stage: ${{ inputs.stage || 'debug' }} - tag_name: ${{ needs.update-release-draft.outputs.tag_name }} build-base-perf-artifacts: needs: update-release-draft @@ -77,7 +82,6 @@ jobs: image_prefix: 'perf' profile: 'release' stage: 'debug' - tag_name: ${{ needs.update-release-draft.outputs.tag_name }} build-head-perf-artifacts: needs: update-release-draft @@ -89,7 +93,6 @@ jobs: image_prefix: 'perf' profile: 'release' stage: 'debug' - tag_name: ${{ needs.update-release-draft.outputs.tag_name }} integration-tests: uses: ./.github/workflows/_integration_tests.yml diff --git a/.github/workflows/hotfix.yml b/.github/workflows/deploy.yml similarity index 93% rename from .github/workflows/hotfix.yml rename to .github/workflows/deploy.yml index 71e79d936..fd1b328fa 100644 --- a/.github/workflows/hotfix.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Hotfix Production +name: Deploy Production run-name: Triggered by ${{ github.actor }} on ${{ github.event_name }} on: workflow_dispatch: @@ -12,7 +12,7 @@ on: required: false concurrency: - group: "hotfix-production-${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}" + group: "deploy-production-${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: false jobs: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4e7bae398..efd557995 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,25 +1,16 @@ -name: Deploy Production and Publish Images +name: Publish Images run-name: Triggered by ${{ github.actor }} on: release: types: - published -env: - # mark:automatic-version - VERSION: "1.0.6" - concurrency: group: "publish-production-${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}" cancel-in-progress: false jobs: - deploy-production: - secrets: inherit - uses: ./.github/workflows/_deploy_production.yml - publish-images-to-ghcr: - needs: deploy-production runs-on: ubuntu-22.04 permissions: # Needed to upload artifacts to a release @@ -42,20 +33,31 @@ jobs: run: | set -xe - IMAGES=(domain api web gateway relay client) + + if [[ "${{ github.event.release.name }}" =~ gateway* ]]; then + image=gateway + # mark:next-gateway-version + VERSION="1.0.6" + elif [[ "${{ github.event.release.name }}" =~ headless* ]]; then + image=client + # mark:next-headless-version + VERSION="1.0.6" + else + echo "Release doesn't require publishing Docker images" + exit 0 + fi + MAJOR_VERSION="${VERSION%%.*}" MAJOR_MINOR_VERSION="${VERSION%.*}" - for image in "${IMAGES[@]}"; do - SOURCE_TAG=${{ steps.login.outputs.registry }}/firezone/${image}:${{ inputs.tag || github.sha }} + SOURCE_TAG=${{ steps.login.outputs.registry }}/firezone/${image}:${{ inputs.tag || github.sha }} - docker buildx imagetools create \ - -t ghcr.io/firezone/${image}:${{ inputs.tag || github.sha }} \ - -t ghcr.io/firezone/${image}:${{ env.VERSION }} \ - -t ghcr.io/firezone/${image}:${{ env.VERSION }} \ - -t ghcr.io/firezone/${image}:${{ env.VERSION }}-${{ inputs.tag || github.sha }} \ - -t ghcr.io/firezone/${image}:latest \ - -t ghcr.io/firezone/${image}:${MAJOR_VERSION} \ - -t ghcr.io/firezone/${image}:${MAJOR_MINOR_VERSION} \ - $SOURCE_TAG - done + docker buildx imagetools create \ + -t ghcr.io/firezone/${image}:${{ inputs.tag || github.sha }} \ + -t ghcr.io/firezone/${image}:${VERSION} \ + -t ghcr.io/firezone/${image}:${VERSION} \ + -t ghcr.io/firezone/${image}:${VERSION}-${{ inputs.tag || github.sha }} \ + -t ghcr.io/firezone/${image}:latest \ + -t ghcr.io/firezone/${image}:${MAJOR_VERSION} \ + -t ghcr.io/firezone/${image}:${MAJOR_MINOR_VERSION} \ + $SOURCE_TAG diff --git a/elixir/Dockerfile b/elixir/Dockerfile index b9e17182b..a10a6caef 100644 --- a/elixir/Dockerfile +++ b/elixir/Dockerfile @@ -221,12 +221,12 @@ RUN npm i -g pnpm # Copy only the files needed to fetch the dependencies, # to leverage Docker layer cache for them -RUN echo "0.0.0" > VERSION COPY mix.exs mix.lock ./ COPY apps/domain/mix.exs ./apps/domain/mix.exs COPY apps/web/mix.exs ./apps/web/mix.exs COPY apps/api/mix.exs ./apps/api/mix.exs COPY config config +COPY sha.exs . # Fetch and compile the dependencies ARG MIX_ENV="prod" @@ -243,7 +243,6 @@ RUN cd apps/web \ # Tailwind needs assets and app directories to look for used classes, # so we can't optimize further at this stage -COPY VERSION ./ COPY priv priv COPY apps apps @@ -298,6 +297,10 @@ ENV APPLICATION_NAME=$APPLICATION_NAME ARG MIX_ENV="prod" COPY --from=builder /app/_build/${MIX_ENV}/rel/${APPLICATION_NAME} ./ +# Populate the SHA pointing to this build +ARG GIT_SHA +RUN echo ${GIT_SHA} > ./GIT_SHA + # Change user to "default" to limit runtime privileges USER default diff --git a/elixir/VERSION b/elixir/VERSION deleted file mode 100644 index af0b7ddbf..000000000 --- a/elixir/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.0.6 diff --git a/elixir/apps/api/mix.exs b/elixir/apps/api/mix.exs index 79c55a1f7..7025cf169 100644 --- a/elixir/apps/api/mix.exs +++ b/elixir/apps/api/mix.exs @@ -2,9 +2,11 @@ defmodule API.MixProject do use Mix.Project def project do + {sha, _} = Code.eval_file(Path.join([__DIR__, "..", "..", "sha.exs"])) + [ app: :api, - version: String.trim(File.read!("../../VERSION")), + version: "0.1.0+#{sha}", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", diff --git a/elixir/apps/domain/mix.exs b/elixir/apps/domain/mix.exs index 7fb0775d1..28633c576 100644 --- a/elixir/apps/domain/mix.exs +++ b/elixir/apps/domain/mix.exs @@ -2,9 +2,11 @@ defmodule Domain.MixProject do use Mix.Project def project do + {sha, _} = Code.eval_file(Path.join([__DIR__, "..", "..", "sha.exs"])) + [ app: :domain, - version: String.trim(File.read!("../../VERSION")), + version: "0.1.0+#{sha}", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", diff --git a/elixir/apps/web/mix.exs b/elixir/apps/web/mix.exs index af58f22d2..c2ac698cf 100644 --- a/elixir/apps/web/mix.exs +++ b/elixir/apps/web/mix.exs @@ -2,9 +2,11 @@ defmodule Web.MixProject do use Mix.Project def project do + {sha, _} = Code.eval_file(Path.join([__DIR__, "..", "..", "sha.exs"])) + [ app: :web, - version: String.trim(File.read!("../../VERSION")), + version: "0.1.0+#{sha}", build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", diff --git a/elixir/mix.exs b/elixir/mix.exs index a1dfa7c18..ba3230d1e 100644 --- a/elixir/mix.exs +++ b/elixir/mix.exs @@ -1,13 +1,13 @@ defmodule Firezone.MixProject do use Mix.Project - @version "VERSION" |> File.read!() |> String.trim() - def project do + {sha, _} = Code.eval_file(Path.join([__DIR__, "sha.exs"])) + [ name: :firezone, apps_path: "apps", - version: @version, + version: "0.1.0+#{sha}", start_permanent: Mix.env() == :prod, test_coverage: [tool: ExCoveralls], preferred_cli_env: [ diff --git a/elixir/sha.exs b/elixir/sha.exs new file mode 100644 index 000000000..30b43ac26 --- /dev/null +++ b/elixir/sha.exs @@ -0,0 +1,7 @@ +case File.read(Path.join([__DIR__, "GIT_SHA"])) do + {:ok, sha} -> + sha |> String.trim() + + _ -> + "deadbeef" +end diff --git a/kotlin/android/app/build.gradle.kts b/kotlin/android/app/build.gradle.kts index 59dd09994..d5a8a5f72 100644 --- a/kotlin/android/app/build.gradle.kts +++ b/kotlin/android/app/build.gradle.kts @@ -55,7 +55,7 @@ android { minSdk = 26 targetSdk = 34 versionCode = (System.currentTimeMillis() / 1000 / 10).toInt() - // mark:automatic-version + // mark:next-android-version versionName = "1.0.3" multiDexEnabled = true testInstrumentationRunner = "dev.firezone.android.core.HiltTestRunner" diff --git a/rust/Cargo.lock b/rust/Cargo.lock index dad75e7cf..d87771bcf 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1143,7 +1143,7 @@ dependencies = [ [[package]] name = "connlib-client-shared" -version = "1.0.6" +version = "0.1.0" dependencies = [ "anyhow", "async-trait", @@ -1170,7 +1170,7 @@ dependencies = [ [[package]] name = "connlib-shared" -version = "1.0.6" +version = "0.1.0" dependencies = [ "anyhow", "base64 0.22.1", @@ -1882,7 +1882,7 @@ dependencies = [ [[package]] name = "firezone-cli-utils" -version = "1.0.6" +version = "0.1.0" dependencies = [ "clap", "tracing", @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "firezone-relay" -version = "1.0.6" +version = "0.1.0" dependencies = [ "anyhow", "backoff", @@ -2059,7 +2059,7 @@ dependencies = [ [[package]] name = "firezone-tunnel" -version = "1.0.6" +version = "0.1.0" dependencies = [ "async-trait", "bimap", @@ -2892,7 +2892,7 @@ dependencies = [ [[package]] name = "http-health-check" -version = "1.0.6" +version = "0.1.0" dependencies = [ "axum 0.7.5", "clap", @@ -2907,7 +2907,7 @@ checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" [[package]] name = "http-test-server" -version = "1.0.6" +version = "0.1.0" dependencies = [ "anyhow", "axum 0.7.5", @@ -3166,7 +3166,7 @@ dependencies = [ [[package]] name = "ip-packet" -version = "1.0.6" +version = "0.1.0" dependencies = [ "hickory-proto", "pnet_packet", @@ -4557,7 +4557,7 @@ dependencies = [ [[package]] name = "phoenix-channel" -version = "1.0.6" +version = "0.1.0" dependencies = [ "backoff", "base64 0.22.1", @@ -5797,7 +5797,7 @@ dependencies = [ [[package]] name = "snownet" -version = "1.0.6" +version = "0.1.0" dependencies = [ "backoff", "boringtun", @@ -5818,7 +5818,7 @@ dependencies = [ [[package]] name = "snownet-tests" -version = "1.0.6" +version = "0.1.0" dependencies = [ "anyhow", "boringtun", diff --git a/rust/connlib/clients/android/Cargo.toml b/rust/connlib/clients/android/Cargo.toml index 7814f8ee9..38e8a02a8 100644 --- a/rust/connlib/clients/android/Cargo.toml +++ b/rust/connlib/clients/android/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "connlib-client-android" -# mark:automatic-version +# mark:next-android-version version = "1.0.6" edition = "2021" diff --git a/rust/connlib/clients/apple/Cargo.toml b/rust/connlib/clients/apple/Cargo.toml index de829d4c0..f95010784 100644 --- a/rust/connlib/clients/apple/Cargo.toml +++ b/rust/connlib/clients/apple/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "connlib-client-apple" -# mark:automatic-version +# mark:next-apple-version version = "1.0.6" edition = "2021" diff --git a/rust/connlib/clients/shared/Cargo.toml b/rust/connlib/clients/shared/Cargo.toml index 298c765f7..93576f430 100644 --- a/rust/connlib/clients/shared/Cargo.toml +++ b/rust/connlib/clients/shared/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "connlib-client-shared" -# mark:automatic-version -version = "1.0.6" +version = "0.1.0" edition = "2021" [features] diff --git a/rust/connlib/shared/Cargo.toml b/rust/connlib/shared/Cargo.toml index 6e7f8f510..6f42af5ae 100644 --- a/rust/connlib/shared/Cargo.toml +++ b/rust/connlib/shared/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "connlib-shared" -# mark:automatic-version -version = "1.0.6" +version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rust/connlib/snownet/Cargo.toml b/rust/connlib/snownet/Cargo.toml index 72654745e..5f217d14a 100644 --- a/rust/connlib/snownet/Cargo.toml +++ b/rust/connlib/snownet/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "snownet" -# mark:automatic-version -version = "1.0.6" +version = "0.1.0" edition = "2021" [dependencies] diff --git a/rust/connlib/tunnel/Cargo.toml b/rust/connlib/tunnel/Cargo.toml index 4b61d28d0..acfc3df4d 100644 --- a/rust/connlib/tunnel/Cargo.toml +++ b/rust/connlib/tunnel/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "firezone-tunnel" -# mark:automatic-version -version = "1.0.6" +version = "0.1.0" edition = "2021" [dependencies] diff --git a/rust/firezone-cli-utils/Cargo.toml b/rust/firezone-cli-utils/Cargo.toml index 2cb1f933d..e4179c152 100644 --- a/rust/firezone-cli-utils/Cargo.toml +++ b/rust/firezone-cli-utils/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "firezone-cli-utils" -# mark:automatic-version -version = "1.0.6" +version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rust/gateway/Cargo.toml b/rust/gateway/Cargo.toml index 27ecbbaf4..045bc61b5 100644 --- a/rust/gateway/Cargo.toml +++ b/rust/gateway/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "firezone-gateway" -# mark:automatic-version +# mark:next-gateway-version version = "1.0.6" edition = "2021" diff --git a/rust/gui-client/src-tauri/Cargo.toml b/rust/gui-client/src-tauri/Cargo.toml index 6ecb17305..93c265293 100644 --- a/rust/gui-client/src-tauri/Cargo.toml +++ b/rust/gui-client/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "firezone-gui-client" -# mark:automatic-version +# mark:next-gui-version version = "1.0.6" description = "Firezone" edition = "2021" diff --git a/rust/headless-client/Cargo.toml b/rust/headless-client/Cargo.toml index 0d56d02ae..1bb0c44e0 100644 --- a/rust/headless-client/Cargo.toml +++ b/rust/headless-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "firezone-headless-client" -# mark:automatic-version +# mark:next-headless-version version = "1.0.6" edition = "2021" authors = ["Firezone, Inc."] diff --git a/rust/http-health-check/Cargo.toml b/rust/http-health-check/Cargo.toml index 223c93e45..f26ee54ea 100644 --- a/rust/http-health-check/Cargo.toml +++ b/rust/http-health-check/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "http-health-check" -# mark:automatic-version -version = "1.0.6" +version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rust/http-test-server/Cargo.toml b/rust/http-test-server/Cargo.toml index c44d6460a..2fec78b0b 100644 --- a/rust/http-test-server/Cargo.toml +++ b/rust/http-test-server/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "http-test-server" -# mark:automatic-version -version = "1.0.6" +version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rust/ip-packet/Cargo.toml b/rust/ip-packet/Cargo.toml index 35a91d1c2..d21adffcb 100644 --- a/rust/ip-packet/Cargo.toml +++ b/rust/ip-packet/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "ip-packet" -# mark:automatic-version -version = "1.0.6" +version = "0.1.0" edition = "2021" authors = ["Firezone, Inc."] publish = false diff --git a/rust/phoenix-channel/Cargo.toml b/rust/phoenix-channel/Cargo.toml index e1f3d4c61..f6a95b32d 100644 --- a/rust/phoenix-channel/Cargo.toml +++ b/rust/phoenix-channel/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "phoenix-channel" -# mark:automatic-version -version = "1.0.6" +version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rust/relay/Cargo.toml b/rust/relay/Cargo.toml index 52a897af2..b38b3c015 100644 --- a/rust/relay/Cargo.toml +++ b/rust/relay/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "firezone-relay" -# mark:automatic-version -version = "1.0.6" +version = "0.1.0" edition = "2021" [dependencies] diff --git a/rust/snownet-tests/Cargo.toml b/rust/snownet-tests/Cargo.toml index 112d59dd5..4597821cd 100644 --- a/rust/snownet-tests/Cargo.toml +++ b/rust/snownet-tests/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "snownet-tests" -# mark:automatic-version -version = "1.0.6" +version = "0.1.0" edition = "2021" [dependencies] diff --git a/scripts/Makefile b/scripts/Makefile index d8220610e..ec0f86d90 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -2,46 +2,69 @@ # See discussion here: https://github.com/firezone/firezone/issues/2041 # and PR changing it here: https://github.com/firezone/firezone/pull/2949 -# These should track the upcoming release for Apple/Android -apple-version = 1.0.5 -android-version = 1.0.3 +# Release Instructions: +# 1. Publish the appropriate drafted release on GitHub +# 2. Bump the appropriate version in this file +# 3. Run `make version` +# 4. Commit the changes +# 5. Open a PR with the changes +# +# CI will prevent pushing assets to releases that are published, so you need to bump +# the relevant versions to in order to push to a newly drafted release. -# Set this to the current latest published release for the Windows/Linux/Gateway packages so -# that links from the website will work -website-version = 1.0.5 +# Tracks the current version to use for generating download links and changelogs +current-apple-version = 1.0.4 +current-android-version = 1.0.2 +current-gateway-version = 1.0.5 +current-gui-version = 1.0.5 +current-headless-version = 1.0.5 -# Set this to the upcoming release for the Windows/Linux/Gateway packages -cargo-version = 1.0.6 -elixir-version = 1.0.6 -ci-version = 1.0.6 - -.PHONY: version apple-version android-version cargo-version ci-version elixir-version +# Tracks the next version to release for each platform +next-apple-version = 1.0.5 +next-android-version = 1.0.3 +next-gateway-version = 1.0.6 +next-gui-version = 1.0.6 +next-headless-version = 1.0.6 +# macOS uses a slightly different sed syntax ifeq ($(shell uname),Darwin) SEDARG := -i '' else SEDARG := -i endif +.PHONY: version apple-version android-version cargo-version ci-version elixir-version + +# Update website changelog and docs to current version and Xcode project file to next version apple-version: - @find swift/ -name "project.pbxproj" -exec sed $(SEDARG) -e 's/MARKETING_VERSION = .*;/MARKETING_VERSION = $(apple-version);/' {} \; + @find website/ -type f -path node_modules -prune -path .next -prune -exec sed $(SEDARG) -e '/mark:current-apple-version/{n;s/[0-9]+\.[0-9]+\.[0-9]+/$(current-apple-version)/g;}' {} \; + @find swift/ -type f -name "project.pbxproj" -exec sed $(SEDARG) -e 's/MARKETING_VERSION = .*;/MARKETING_VERSION = $(next-apple-version);/' {} \; +# Update website changelog to current version and Gradle files to next version android-version: - @find kotlin/ -name "*.gradle.kts" -exec sed $(SEDARG) -e '/mark:automatic-version/{n;s/versionName =.*/versionName = "$(android-version)"/;}' {} \; + @find website/ -type f -path node_modules -prune -path .next -prune -exec sed $(SEDARG) -e '/mark:current-android-version/{n;s/[0-9]+\.[0-9]+\.[0-9]+/$(current-android-version)/g;}' {} \; + @find kotlin/ -type f -name "*.gradle.kts" -exec sed $(SEDARG) -e '/mark:next-android-version/{n;s/versionName =.*/versionName = "$(next-android-version)"/;}' {} \; -website-version: +# Update website changelog and DL links to current version and cargo files, CI release to next version +gateway-version: @# The website hosts permalinks to our published packages and binaries - @find website/ -name "redirects.js" -exec sed $(SEDARG) -e '/mark:automatic-version/{n;s/[0-9]*\.[0-9]*\.[0-9]*/$(website-version)/g;}' {} \; + @find website/ -type f -path node_modules -prune -path .next -prune -exec sed $(SEDARG) -e '/mark:current-gateway-version/{n;s/[0-9]+\.[0-9]+\.[0-9]+/$(current-gateway-version)/g;}' {} \; + @find .github/ -type f -exec sed $(SEDARG) -e '/mark:next-gateway-version/{n;s/[0-9]+\.[0-9]+\.[0-9]+/$(next-gateway-version)/g;}' {} \; -cargo-version: - @find rust/ -name "Cargo.toml" -exec sed $(SEDARG) -e '/mark:automatic-version/{n;s/[0-9]*\.[0-9]*\.[0-9]*/$(cargo-version)/;}' {} \; +# Update website changelog and DL links to current version and cargo files, CI release to next version +gui-version: + @# The website hosts permalinks to our published packages and binaries + @find website/ -type f -path node_modules -prune -path .next -prune -exec sed $(SEDARG) -e '/mark:current-gui-version/{n;s/[0-9]+\.[0-9]+\.[0-9]+/$(current-gui-version)/g;}' {} \; + @find .github/ -type f -exec sed $(SEDARG) -e '/mark:next-gui-version/{n;s/[0-9]+\.[0-9]+\.[0-9]+/$(next-gui-version)/g;}' {} \; + @find rust/ -type f -name "Cargo.toml" -exec sed $(SEDARG) -e '/mark:next-gui-version/{n;s/[0-9]+\.[0-9]+\.[0-9]+/$(next-gui-version)/;}' {} \; @cd rust && cargo update --workspace -ci-version: - @find .github/ -name "*.yml" -exec sed $(SEDARG) -e '/mark:automatic-version/{n;s/[0-9]*\.[0-9]*\.[0-9]*/$(ci-version)/;}' {} \; +# Update website changelog and DL links to current version and cargo files, CI release to next version +headless-version: + @# The website hosts permalinks to our published packages and binaries + @find website/ -type f -path node_modules -prune -path .next -prune -exec sed $(SEDARG) -e '/mark:current-headless-version/{n;s/[0-9]+\.[0-9]+\.[0-9]+/$(current-headless-version)/g;}' {} \; + @find .github/ -type f -exec sed $(SEDARG) -e '/mark:next-headless-version/{n;s/[0-9]+\.[0-9]+\.[0-9]+/$(next-headless-version)/g;}' {} \; + @find rust/ -type f -name "Cargo.toml" -exec sed $(SEDARG) -e '/mark:next-headless-version/{n;s/[0-9]+\.[0-9]+\.[0-9]+/$(next-headless-version)/;}' {} \; + @cd rust && cargo update --workspace -elixir-version: - @# Elixir can set its Application version from a file, but other components aren't so flexible. - @echo $(elixir-version) > elixir/VERSION - -version: apple-version android-version cargo-version ci-version elixir-version website-version +version: apple-version android-version gateway-version gui-version headless-version diff --git a/website/redirects.js b/website/redirects.js index 9a1f5ee5e..7aaa75add 100644 --- a/website/redirects.js +++ b/website/redirects.js @@ -10,15 +10,15 @@ module.exports = [ { source: "/dl/firezone-client-gui-windows/latest/x86_64", destination: - // mark:automatic-version - "https://www.github.com/firezone/firezone/releases/download/1.0.5/firezone-client-gui-windows_1.0.5_x86_64.msi", + // mark:current-gui-version + "https://www.github.com/firezone/firezone/releases/download/gui-client-1.0.5/firezone-client-gui-windows_1.0.5_x86_64.msi", permanent: false, }, // versioned { source: "/dl/firezone-client-gui-windows/:version/x86_64", destination: - "https://www.github.com/firezone/firezone/releases/download/:version/firezone-client-gui-windows_:version_x86_64.msi", + "https://www.github.com/firezone/firezone/releases/download/gui-client-:version/firezone-client-gui-windows_:version_x86_64.msi", permanent: false, }, /* @@ -30,67 +30,67 @@ module.exports = [ { source: "/dl/firezone-client-gui-linux/latest/x86_64", destination: - // mark:automatic-version - "https://www.github.com/firezone/firezone/releases/download/1.0.5/firezone-client-gui-linux_1.0.5_x86_64.deb", + // mark:current-gui-version + "https://www.github.com/firezone/firezone/releases/download/gui-client-1.0.5/firezone-client-gui-linux_1.0.5_x86_64.deb", permanent: false, }, { source: "/dl/firezone-client-gui-linux/latest/aarch64", destination: - // mark:automatic-version - "https://www.github.com/firezone/firezone/releases/download/1.0.5/firezone-client-gui-linux_1.0.5_aarch64.deb", + // mark:current-gui-version + "https://www.github.com/firezone/firezone/releases/download/gui-client-1.0.5/firezone-client-gui-linux_1.0.5_aarch64.deb", permanent: false, }, { source: "/dl/firezone-client-headless-linux/latest/x86_64", destination: - // mark:automatic-version - "https://www.github.com/firezone/firezone/releases/download/1.0.5/firezone-client-headless-linux_1.0.5_x86_64", + // mark:current-headless-version + "https://www.github.com/firezone/firezone/releases/download/headless-client-1.0.5/firezone-client-headless-linux_1.0.5_x86_64", permanent: false, }, { source: "/dl/firezone-client-headless-linux/latest/aarch64", destination: - // mark:automatic-version - "https://www.github.com/firezone/firezone/releases/download/1.0.5/firezone-client-headless-linux_1.0.5_aarch64", + // mark:current-headless-version + "https://www.github.com/firezone/firezone/releases/download/headless-client-1.0.5/firezone-client-headless-linux_1.0.5_aarch64", permanent: false, }, { source: "/dl/firezone-client-headless-linux/latest/armv7", destination: - // mark:automatic-version - "https://www.github.com/firezone/firezone/releases/download/1.0.5/firezone-client-headless-linux_1.0.5_armv7", + // mark:current-headless-version + "https://www.github.com/firezone/firezone/releases/download/headless-client-1.0.5/firezone-client-headless-linux_1.0.5_armv7", permanent: false, }, // versioned { source: "/dl/firezone-client-gui-linux/:version/x86_64", destination: - "https://www.github.com/firezone/firezone/releases/download/:version/firezone-client-gui-linux_:version_x86_64.deb", + "https://www.github.com/firezone/firezone/releases/download/gui-client-:version/firezone-client-gui-linux_:version_x86_64.deb", permanent: false, }, { source: "/dl/firezone-client-gui-linux/:version/aarch64", destination: - "https://www.github.com/firezone/firezone/releases/download/:version/firezone-client-gui-linux_:version_aarch64.deb", + "https://www.github.com/firezone/firezone/releases/download/gui-client-:version/firezone-client-gui-linux_:version_aarch64.deb", permanent: false, }, { source: "/dl/firezone-client-headless-linux/:version/x86_64", destination: - "https://www.github.com/firezone/firezone/releases/download/:version/firezone-client-headless-linux_:version_x86_64", + "https://www.github.com/firezone/firezone/releases/download/headless-client-:version/firezone-client-headless-linux_:version_x86_64", permanent: false, }, { source: "/dl/firezone-client-headless-linux/:version/aarch64", destination: - "https://www.github.com/firezone/firezone/releases/download/:version/firezone-client-headless-linux_:version_aarch64", + "https://www.github.com/firezone/firezone/releases/download/headless-client-:version/firezone-client-headless-linux_:version_aarch64", permanent: false, }, { source: "/dl/firezone-client-headless-linux/:version/armv7", destination: - "https://www.github.com/firezone/firezone/releases/download/:version/firezone-client-headless-linux_:version_armv7", + "https://www.github.com/firezone/firezone/releases/download/headless-client-:version/firezone-client-headless-linux_:version_armv7", permanent: false, }, /* @@ -102,41 +102,41 @@ module.exports = [ { source: "/dl/firezone-gateway/latest/x86_64", destination: - // mark:automatic-version - "https://www.github.com/firezone/firezone/releases/download/1.0.5/firezone-gateway_1.0.5_x86_64", + // mark:current-gateway-version + "https://www.github.com/firezone/firezone/releases/download/gateway-1.0.5/firezone-gateway_1.0.5_x86_64", permanent: false, }, { source: "/dl/firezone-gateway/latest/aarch64", destination: - // mark:automatic-version - "https://www.github.com/firezone/firezone/releases/download/1.0.5/firezone-gateway_1.0.5_aarch64", + // mark:current-gateway-version + "https://www.github.com/firezone/firezone/releases/download/gateway-1.0.5/firezone-gateway_1.0.5_aarch64", permanent: false, }, { source: "/dl/firezone-gateway/latest/armv7", destination: - // mark:automatic-version - "https://www.github.com/firezone/firezone/releases/download/1.0.5/firezone-gateway_1.0.5_armv7", + // mark:current-gateway-version + "https://www.github.com/firezone/firezone/releases/download/gateway-1.0.5/firezone-gateway_1.0.5_armv7", permanent: false, }, // versioned { source: "/dl/firezone-gateway/:version/x86_64", destination: - "https://www.github.com/firezone/firezone/releases/download/:version/firezone-gateway_:version_x86_64", + "https://www.github.com/firezone/firezone/releases/download/gateway-:version/firezone-gateway_:version_x86_64", permanent: false, }, { source: "/dl/firezone-gateway/:version/aarch64", destination: - "https://www.github.com/firezone/firezone/releases/download/:version/firezone-gateway_:version_aarch64", + "https://www.github.com/firezone/firezone/releases/download/gateway-:version/firezone-gateway_:version_aarch64", permanent: false, }, { source: "/dl/firezone-gateway/:version/armv7", destination: - "https://www.github.com/firezone/firezone/releases/download/:version/firezone-gateway_:version_armv7", + "https://www.github.com/firezone/firezone/releases/download/gateway-:version/firezone-gateway_:version_armv7", permanent: false, }, ];