Skip to content

Commit

Permalink
github: app publish tasks improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kar committed Oct 30, 2024
1 parent 8313461 commit cd215f2
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 27 deletions.
64 changes: 46 additions & 18 deletions .github/workflows/androidfamily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,63 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
submodules: false

- name: Set Up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Initialize and update six-android
run: |
git submodule update --init --recursive .
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Get six-android Commit SHA
id: get_ref
run: |
REPO_A_REF=$(git -C . rev-parse HEAD)
echo "REPO_A_REF=${REPO_A_REF}"
echo "REPO_A_REF=${REPO_A_REF}" >> $GITHUB_ENV
- name: Get Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Get Workflow Run ID for Commit SHA of six-android
id: get_run_id
run: |
set -o pipefail # Ensure any command failure in the pipeline fails the step
REPO="blokadaorg/six-android"
REF=${{ env.REPO_A_REF }}
- name: Build common lib
# Find the workflow run ID for the specific commit SHA
WORKFLOW_RUN_ID=$(curl -s -H "Authorization: token ${{ secrets.SIXCOMMON_TOKEN }}" \
"https://api.github.com/repos/$REPO/actions/runs?status=completed&branch=main" \
| jq -r ".workflow_runs[] | select(.head_sha == \"$REF\").id" | head -n 1)
echo "WORKFLOW_RUN_ID=${WORKFLOW_RUN_ID}" >> $GITHUB_ENV
- name: Download Artifact from six-android
if: env.WORKFLOW_RUN_ID # Only proceed if we have a valid workflow run ID
run: |
git config --global url."https://${{ secrets.GIT_TOKEN }}@github.com/".insteadOf "[email protected]:"
make sixcommon
set -o pipefail # Ensure any command failure in the pipeline fails the step
REPO="blokadaorg/six-android"
ARTIFACT_NAME="blokadafamily.aab"
WORKFLOW_RUN_ID=${{ env.WORKFLOW_RUN_ID }}
# Get the artifact download URL
ARTIFACT_URL=$(curl -s -H "Authorization: token ${{ secrets.SIXCOMMON_TOKEN }}" \
"https://api.github.com/repos/$REPO/actions/runs/$WORKFLOW_RUN_ID/artifacts" \
| jq -r ".artifacts[] | select(.name == \"$ARTIFACT_NAME\").archive_download_url")
- name: Build aab
run: make aabfamily
# Download the artifact
curl -L -H "Authorization: token ${{ secrets.SIXCOMMON_TOKEN }}" \
-o artifact.zip "$ARTIFACT_URL"
- name: Unzip six-android artifact
if: env.WORKFLOW_RUN_ID # Ensure the artifact was successfully downloaded
run: |
mkdir -p artifact
unzip artifact.zip -d artifact/
echo "Checking extracted paths"
ls -la artifact/
- name: Sign app AAB
uses: r0adkll/sign-android-release@v1
id: sign_app
with:
releaseDirectory: six-android/app/build/outputs/bundle/familyRelease
releaseDirectory: six-android/artifact
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Blokada 6 for iOS (Publish)
name: Internal Blokada 6 for iOS

on:
workflow_dispatch:
Expand All @@ -25,10 +25,24 @@ jobs:
with:
channel: 'stable'

# Manually install FVM and add it to PATH
- name: Install FVM
run: |
flutter pub global activate fvm
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Verify FVM installation
run: fvm --version

- name: Build common lib
run: |
git config --global url."https://${{ secrets.GIT_TOKEN }}@github.com/".insteadOf "[email protected]:"
make sixcommon
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21' # Replace with the Go version you need

- name: Set up ruby env
uses: ruby/setup-ruby@v1
Expand Down Expand Up @@ -56,11 +70,3 @@ jobs:
ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
ASC_KEY: ${{ secrets.ASC_PRIVATE_KEY }}
KEYCHAIN_PATH: ~/Library/Keychains/signing_temp.keychain-db

- name: Upload app-store ipa and dsyms to artifacts
uses: actions/upload-artifact@v4
with:
name: app-store ipa & dsyms
path: |
${{ github.workspace }}/example-iOS.ipa
${{ github.workspace }}/*.app.dSYM.zip

0 comments on commit cd215f2

Please sign in to comment.