Skip to content

Commit

Permalink
ci: pass secrets to deploy step, misc fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding committed Nov 13, 2024
1 parent 06da72c commit b1c01be
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: build_release
on:
workflow_call: # for beta releases from main - release.yml / dispatch_beta_release
inputs:
needs_trapeze_artifacts:
is_main_build:
type: boolean
required: true
push:
Expand All @@ -12,7 +12,7 @@ on:
- "test-[0-9]+.[0-9]+.[0-9]+"

env:
ARTIFACT_LABEL: ${{ github.ref == 'refs/heads/main' && github.sha || github.ref_name }}
ARTIFACT_LABEL: ${{ inputs.is_main_build && github.sha || github.ref_name }}

jobs:
build_web:
Expand Down Expand Up @@ -47,13 +47,13 @@ jobs:

- name: Compress artifacts
run: |
zip -r Voyager-Web-${ARTIFACT_LABEL}.zip dist
zip -r Voyager-Web-$ARTIFACT_LABEL.zip dist
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Voyager-Web-${ARTIFACT_LABEL}.zip
path: Voyager-Web-${ARTIFACT_LABEL}.zip
name: Voyager-Web-${{ env.ARTIFACT_LABEL }}.zip
path: Voyager-Web-${{ env.ARTIFACT_LABEL }}.zip

build_ios:
environment: deploy
Expand All @@ -65,7 +65,7 @@ jobs:
- uses: actions/checkout@v4

- name: Download bumped version artifacts
if: inputs.needs_trapeze_artifacts
if: inputs.is_main_build
uses: actions/download-artifact@v4
with:
name: trapeze-artifacts
Expand Down Expand Up @@ -111,16 +111,16 @@ jobs:
- name: Upload iOS IPA as artifact
uses: actions/upload-artifact@v4
with:
name: Voyager-iOS-${ARTIFACT_LABEL}.ipa
path: Voyager-iOS-${ARTIFACT_LABEL}.ipa
name: Voyager-iOS-${{ env.ARTIFACT_LABEL }}.ipa
path: Voyager-iOS-${{ env.ARTIFACT_LABEL }}.ipa

build_android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Download bumped version artifacts
if: inputs.needs_trapeze_artifacts
if: inputs.is_main_build
uses: actions/download-artifact@v4
with:
name: trapeze-artifacts
Expand Down Expand Up @@ -154,13 +154,13 @@ jobs:
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}

- run: mv android/app/build/outputs/apk/release/app-release.apk Voyager-Android-${{ github.ref_name }}.apk
- run: mv android/app/build/outputs/apk/release/app-release.apk Voyager-Android-${{ env.ARTIFACT_LABEL }}.apk

- name: Send to Artifacts
uses: actions/upload-artifact@v4
with:
name: Voyager-Android-${ARTIFACT_LABEL}.apk
path: Voyager-Android-${ARTIFACT_LABEL}.apk
name: Voyager-Android-${{ env.ARTIFACT_LABEL }}.apk
path: Voyager-Android-${{ env.ARTIFACT_LABEL }}.apk

build_android_play:
environment: deploy
Expand All @@ -172,7 +172,7 @@ jobs:
- uses: actions/checkout@v4

- name: Download bumped version artifacts
if: inputs.needs_trapeze_artifacts
if: inputs.is_main_build
uses: actions/download-artifact@v4
with:
name: trapeze-artifacts
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ jobs:
needs: bump_src
uses: ./.github/workflows/build_release.yml
with:
needs_trapeze_artifacts: true
is_main_build: true
secrets: inherit
permissions:
contents: write # needed for create_release, even though it won't be called

Expand Down
2 changes: 1 addition & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ default_platform(:ios)

ENV['app_identifier'] = 'app.vger.voyager'
ENV['app_name_sanitized'] = 'App'
ENV['ios_output'] = "Voyager-iOS-#{ENV['GITHUB_REF_NAME']}.ipa"
ENV['ios_output'] = "Voyager-iOS-#{ENV['ARTIFACT_LABEL']}.ipa"

platform :ios do
before_all do
Expand Down

0 comments on commit b1c01be

Please sign in to comment.