Skip to content

Commit

Permalink
Create and push tag before updating checklist
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Sep 6, 2024
1 parent 2778eee commit 60d27cf
Showing 1 changed file with 28 additions and 29 deletions.
57 changes: 28 additions & 29 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,35 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}

createTag:
needs: validateActor
if: ${{ github.ref == 'refs/heads/staging' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Setup git for OSBotify
uses: ./.github/actions/composite/setupGitForOSBotifyApp
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }}

- name: Create and push tag
run: |
git tag "$(jq -r .version < package.json)"
git push origin --tags
# Note: we're updating the checklist before running the deploys and assuming that it will succeed on at least one platform
deployChecklist:
name: Create or update deploy checklist
uses: ./.github/workflows/createDeployChecklist.yml
if: ${{ github.ref == 'refs/heads/staging' }}
needs: validateActor
needs: createTag
secrets: inherit

android:
Expand All @@ -45,7 +68,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure MapBox SDK
run: ./scripts/setup-mapbox-sdk.sh ${{ secrets.MAPBOX_SDK_DOWNLOAD_TOKEN }}

Expand Down Expand Up @@ -446,24 +469,11 @@ jobs:
if: ${{ github.ref == 'refs/heads/staging' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }}
needs: [checkDeploymentSuccess]
steps:
# The command "gh release create" also creates and pushes a tag for the version if one does not already exist,
# So we need to checkout the staging branch and create that tag from the staging branch.
- name: Checkout staging branch
uses: actions/checkout@v4
with:
ref: staging
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Setup git for OSBotify
uses: ./.github/actions/composite/setupGitForOSBotifyApp
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }}

- name: Get current app version
run: echo "STAGING_VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"
run: echo "STAGING_VERSION=$(jq -r .version < package.json)" >> "$GITHUB_ENV"

- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
Expand All @@ -486,7 +496,7 @@ jobs:
./web-build-tar-gz/webBuild.tar.gz \
./web-build-zip/webBuild.zip
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}

- name: Warn deployers if staging deploy failed
if: ${{ failure() }}
Expand All @@ -513,17 +523,6 @@ jobs:
steps:
- uses: actions/checkout@v4
name: Checkout
with:
ref: production
token: ${{ secrets.OS_BOTIFY_TOKEN }}

- name: Setup git for OSBotify
uses: ./.github/actions/composite/setupGitForOSBotifyApp
id: setupGitForOSBotify
with:
GPG_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }}

- name: Get current app version
run: echo "PRODUCTION_VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"
Expand All @@ -537,7 +536,7 @@ jobs:
./web-build-tar-gz/webBuild.tar.gz \
./web-build-zip/webBuild.zip
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}

- name: 🚀 Edit the release to be no longer a prerelease 🚀
run: |
Expand Down

0 comments on commit 60d27cf

Please sign in to comment.