CI change

This commit is contained in:
Jonas Bark
2025-10-17 11:21:50 +02:00
parent 90144948f4
commit 29ef0dfaf4

View File

@@ -54,7 +54,7 @@ jobs:
uses: actions/checkout@v3
- name: Install certificates
if: github.event.inputs.build_mac || github.event.inputs.build_ios
if: inputs.build_mac || inputs.build_ios
env:
DEVELOPER_ID_APPLICATION_P12_BASE64_MAC: ${{ secrets.DEVELOPER_ID_APPLICATION_P12_BASE64_MAC }}
DEVELOPER_ID_INSTALLER_P12_BASE64_MAC: ${{ secrets.DEVELOPER_ID_INSTALLER_P12_BASE64_MAC }}
@@ -102,20 +102,20 @@ jobs:
cache: true
- name: 🚀 Shorebird Release macOS
if: github.event.inputs.build_mac
if: inputs.build_mac
uses: shorebirdtech/shorebird-release@v1
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
platform: macos
- name: Decode Keystore
if: github.event.inputs.build_android
if: inputs.build_android
run: |
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/android.keystore;
echo "${{ secrets.KEYSTORE_PROPERTIES }}" > android/keystore.properties;
- name: 🚀 Shorebird Release Android
if: github.event.inputs.build_android
if: inputs.build_android
uses: shorebirdtech/shorebird-release@v1
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
@@ -123,25 +123,25 @@ jobs:
args: "--artifact=apk"
- name: Set Up Flutter
if: github.event.inputs.build_web
if: inputs.build_web
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Build Web
if: github.event.inputs.build_web
if: inputs.build_web
run: flutter build web --release --base-href "/swiftcontrol/"
- name: Upload static files as artifact
if: github.event.inputs.build_web
if: inputs.build_web
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: build/web
- name: Web Deploy
if: github.event.inputs.build_web
if: inputs.build_web
uses: actions/deploy-pages@v4
- name: Extract latest changelog
@@ -152,7 +152,7 @@ jobs:
./scripts/get_latest_changelog.sh | head -c 500 > whatsnew/whatsnew-en-US
- name: 🚀 Shorebird Release iOS
if: github.event.inputs.build_ios
if: inputs.build_ios
uses: shorebirdtech/shorebird-release@v1
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
@@ -160,7 +160,7 @@ jobs:
args: "--export-options-plist ios/ExportOptions.plist"
- name: Prepare App Store authentication key
if: github.event.inputs.build_ios || github.event.inputs.build_mac
if: inputs.build_ios || inputs.build_mac
env:
API_KEY_BASE64: ${{ secrets.APPSTORE_API_KEY_FILE_BASE64 }}
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
@@ -169,7 +169,7 @@ jobs:
printf %s "$API_KEY_BASE64" | base64 -D > "./private_keys/AuthKey_${APPSTORE_API_KEY}.p8";
- name: Upload to Play Store
if: github.event.inputs.build_android
if: inputs.build_android
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
@@ -179,7 +179,7 @@ jobs:
whatsNewDirectory: whatsnew
- name: Upload to macOS App Store
if: github.event.inputs.build_mac
if: inputs.build_mac
env:
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
APPSTORE_API_ISSUER_ID: ${{ secrets.APPSTORE_API_ISSUER_ID }}
@@ -188,7 +188,7 @@ jobs:
xcrun altool --upload-app -f SwiftControl.pkg -t osx --apiKey "$APPSTORE_API_KEY" --apiIssuer "$APPSTORE_API_ISSUER_ID";
- name: Upload to iOS App Store
if: github.event.inputs.build_ios
if: inputs.build_ios
env:
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
APPSTORE_API_ISSUER_ID: ${{ secrets.APPSTORE_API_ISSUER_ID }}
@@ -196,42 +196,44 @@ jobs:
xcrun altool --upload-app -f build/ios/ipa/swift_play.ipa -t ios --apiKey "$APPSTORE_API_KEY" --apiIssuer "$APPSTORE_API_ISSUER_ID";
- name: Handle Android archives
if: github.event.inputs.build_android && github.event.inputs.build_github
if: inputs.build_android && inputs.build_github
run: |
cp build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/SwiftControl.android.apk
- name: Code Signing of macOS app
if: github.event.inputs.build_mac && github.event.inputs.build_github
if: inputs.build_mac && inputs.build_github
run: /usr/bin/codesign --deep --force -s "$DEVELOPER_ID_APPLICATION_SIGNING_IDENTITY" --entitlements ../../../../../macos/Runner/Release.entitlements --options runtime SwiftControl.app -v
working-directory: build/macos/Build/Products/Release
env:
DEVELOPER_ID_APPLICATION_SIGNING_IDENTITY: ${{ secrets.DEVELOPER_ID_APPLICATION_SIGNING_IDENTITY }}
- name: Handle macOS archives
if: github.event.inputs.build_mac && github.event.inputs.build_github
if: inputs.build_mac && inputs.build_github
run: |
cd build/macos/Build/Products/Release/
zip -r SwiftControl.macos.zip SwiftControl.app/
- name: Upload Android Artifacts
if: github.event.inputs.build_android && github.event.inputs.build_github
if: inputs.build_android && inputs.build_github
uses: actions/upload-artifact@v4
with:
overwrite: true
name: Releases
path: |
build/app/outputs/flutter-apk/SwiftControl.android.apk
- name: Upload macOS Artifacts
if: github.event.inputs.build_mac && github.event.inputs.build_github
if: inputs.build_mac && inputs.build_github
uses: actions/upload-artifact@v4
with:
overwrite: true
name: Releases
path: |
build/macos/Build/Products/Release/SwiftControl.macos.zip
#10 Extract Version
- name: Extract version from pubspec.yaml
if: github.event.inputs.build_github
if: inputs.build_github
id: extract_version
run: |
version=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r')
@@ -239,7 +241,7 @@ jobs:
#11 Check if Tag Exists
- name: Check if Tag Exists
if: github.event.inputs.build_github
if: inputs.build_github
id: check_tag
run: |
if git rev-parse "v${{ env.VERSION }}" >/dev/null 2>&1; then
@@ -250,7 +252,7 @@ jobs:
#12 Modify Tag if it Exists
- name: Modify Tag
if: env.TAG_EXISTS && github.event.inputs.build_github
if: env.TAG_EXISTS && inputs.build_github
id: modify_tag
run: |
new_version="${{ env.VERSION }}-build-${{ github.run_number }}"
@@ -258,7 +260,7 @@ jobs:
#13 Create Release
- name: Create Release
if: github.event.inputs.build_github
if: inputs.build_github
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/flutter-apk/SwiftControl.android.apk,build/macos/Build/Products/Release/SwiftControl.macos.zip"
@@ -270,7 +272,7 @@ jobs:
windows:
needs: build
if: github.event.inputs.build_windows && github.event.inputs.build_github
if: inputs.build_windows && inputs.build_github
name: Build & Release on Windows
runs-on: windows-latest