Merge pull request #6 from Y0ngg4n/dependabot/github_actions/dot-gith… #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Platform Releases | |
on: | |
push: | |
branches: | |
- master | |
- ci | |
- 'releases/**' | |
pull_request: | |
branches: | |
- master | |
- ci | |
- 'releases/**' | |
jobs: | |
version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: version | |
path: version.yml | |
windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Write Env File | |
run: | | |
echo "REST_API_URL=$REST_API_URL" >> .env | |
echo "CLIENT_ID=$CLIENT_ID" >> .env | |
echo "CLIENT_SECRET=$CLIENT_SECRET" >> .env | |
echo "CLIENT_ID_WEB=$CLIENT_ID_WEB" >> .env | |
echo "CLIENT_SECRET_WEB=$CLIENT_SECRET_WEB" >> .env | |
env: | |
REST_API_URL: ${{ secrets.ENV_REST_API_URL }} | |
CLIENT_ID: ${{ secrets.ENV_CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.ENV_CLIENT_SECRET }} | |
CLIENT_ID_WEB: ${{ secrets.ENV_CLIENT_ID_WEB }} | |
CLIENT_SECRET_WEB: ${{ secrets.ENV_CLIENT_SECRET_WEB }} | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: beta | |
- run: flutter config --enable-windows-desktop | |
- run: flutter doctor -v | |
- run: flutter build windows | |
- uses: papeloto/action-zip@v1 | |
with: | |
files: build/windows/runner/Release | |
dest: volt_campaigner-windows.zip | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: volt_campaigner-windows | |
path: volt_campaigner-windows.zip | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- run: sudo apt-get update -y | |
- run: sudo apt-get install -y ninja-build libgtk-3-dev libblkid-dev | |
- uses: actions/checkout@v2 | |
- name: Write Env File | |
run: | | |
echo "REST_API_URL=$REST_API_URL" >> .env | |
echo "CLIENT_ID=$CLIENT_ID" >> .env | |
echo "CLIENT_SECRET=$CLIENT_SECRET" >> .env | |
echo "CLIENT_ID_WEB=$CLIENT_ID_WEB" >> .env | |
echo "CLIENT_SECRET_WEB=$CLIENT_SECRET_WEB" >> .env | |
env: | |
REST_API_URL: ${{ secrets.ENV_REST_API_URL }} | |
CLIENT_ID: ${{ secrets.ENV_CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.ENV_CLIENT_SECRET }} | |
CLIENT_ID_WEB: ${{ secrets.ENV_CLIENT_ID_WEB }} | |
CLIENT_SECRET_WEB: ${{ secrets.ENV_CLIENT_SECRET_WEB }} | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: dev | |
- run: flutter config --enable-linux-desktop | |
- run: flutter doctor -v | |
- run: flutter pub get | |
- run: flutter build linux | |
- uses: papeloto/action-zip@v1 | |
with: | |
files: build/linux/x64/release/bundle | |
dest: volt_campaigner-linux.zip | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: volt_campaigner-linux | |
path: volt_campaigner-linux.zip | |
web: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Write Env File | |
run: | | |
echo "REST_API_URL=$REST_API_URL" >> .env | |
echo "CLIENT_ID=$CLIENT_ID" >> .env | |
echo "CLIENT_SECRET=$CLIENT_SECRET" >> .env | |
echo "CLIENT_ID_WEB=$CLIENT_ID_WEB" >> .env | |
echo "CLIENT_SECRET_WEB=$CLIENT_SECRET_WEB" >> .env | |
env: | |
REST_API_URL: ${{ secrets.ENV_REST_API_URL }} | |
CLIENT_ID: ${{ secrets.ENV_CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.ENV_CLIENT_SECRET }} | |
CLIENT_ID_WEB: ${{ secrets.ENV_CLIENT_ID_WEB }} | |
CLIENT_SECRET_WEB: ${{ secrets.ENV_CLIENT_SECRET_WEB }} | |
- uses: subosito/flutter-action@v1 | |
- run: flutter config --enable-web | |
- run: flutter doctor -v | |
- run: flutter pub get | |
- run: flutter build web | |
- uses: papeloto/action-zip@v1 | |
with: | |
files: build/web | |
dest: volt_campaigner-web.zip | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: volt_campaigner-web | |
path: volt_campaigner-web.zip | |
android: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: '12.x' | |
- name: Configure Keystore | |
run: | | |
echo "$ANDROID_KEYSTORE_FILE" > keystore.jks.b64 | |
base64 -d -i keystore.jks.b64 > android/key.jks | |
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> android/key.properties | |
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> android/key.properties | |
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> android/key.properties | |
cat android/key.properties | |
env: | |
ANDROID_KEYSTORE_FILE: ${{ secrets.ANDROID_KEYSTORE_FILE }} | |
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }} | |
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }} | |
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }} | |
- name: Write Env File | |
run: | | |
echo "REST_API_URL=$REST_API_URL" >> .env | |
echo "CLIENT_ID=$CLIENT_ID" >> .env | |
echo "CLIENT_SECRET=$CLIENT_SECRET" >> .env | |
echo "CLIENT_ID_WEB=$CLIENT_ID_WEB" >> .env | |
echo "CLIENT_SECRET_WEB=$CLIENT_SECRET_WEB" >> .env | |
ls | |
cat .env | |
env: | |
REST_API_URL: ${{ secrets.ENV_REST_API_URL }} | |
CLIENT_ID: ${{ secrets.ENV_CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.ENV_CLIENT_SECRET }} | |
CLIENT_ID_WEB: ${{ secrets.ENV_CLIENT_ID_WEB }} | |
CLIENT_SECRET_WEB: ${{ secrets.ENV_CLIENT_SECRET_WEB }} | |
- uses: subosito/flutter-action@v1 | |
- run: flutter doctor -v | |
- run: flutter pub get | |
- run: flutter build apk | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: volt_campaigner-android | |
path: build/app/outputs/apk/release/app-release.apk | |
mac: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Write Env File | |
run: | | |
echo "REST_API_URL=$REST_API_URL" >> .env | |
echo "CLIENT_ID=$CLIENT_ID" >> .env | |
echo "CLIENT_SECRET=$CLIENT_SECRET" >> .env | |
echo "CLIENT_ID_WEB=$CLIENT_ID_WEB" >> .env | |
echo "CLIENT_SECRET_WEB=$CLIENT_SECRET_WEB" >> .env | |
env: | |
REST_API_URL: ${{ secrets.ENV_REST_API_URL }} | |
CLIENT_ID: ${{ secrets.ENV_CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.ENV_CLIENT_SECRET }} | |
CLIENT_ID_WEB: ${{ secrets.ENV_CLIENT_ID_WEB }} | |
CLIENT_SECRET_WEB: ${{ secrets.ENV_CLIENT_SECRET_WEB }} | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- uses: subosito/flutter-action@v1 | |
- run: flutter config --enable-macos-desktop | |
- run: flutter doctor -v | |
- run: flutter pub get | |
- run: flutter build macos --release | |
- uses: papeloto/action-zip@v1 | |
with: | |
files: build/macos/Release/Product | |
dest: volt_campaigner-mac.zip | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: volt_campaigner-mac | |
path: volt_campaigner-mac.zip | |
ios: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Write Env File | |
run: | | |
echo "REST_API_URL=$REST_API_URL" >> .env | |
echo "CLIENT_ID=$CLIENT_ID" >> .env | |
echo "CLIENT_SECRET=$CLIENT_SECRET" >> .env | |
echo "CLIENT_ID_WEB=$CLIENT_ID_WEB" >> .env | |
echo "CLIENT_SECRET_WEB=$CLIENT_SECRET_WEB" >> .env | |
env: | |
REST_API_URL: ${{ secrets.ENV_REST_API_URL }} | |
CLIENT_ID: ${{ secrets.ENV_CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.ENV_CLIENT_SECRET }} | |
CLIENT_ID_WEB: ${{ secrets.ENV_CLIENT_ID_WEB }} | |
CLIENT_SECRET_WEB: ${{ secrets.ENV_CLIENT_SECRET_WEB }} | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Install Apple Certificate | |
uses: apple-actions/import-codesign-certs@v1 | |
with: | |
p12-file-base64: ${{ secrets.IOS_DISTRIBUTION_P12 }} | |
p12-password: ${{ secrets.IOS_DISTRIBUTION_P12_PASSWORD }} | |
- name: Install the provisioning profile | |
env: | |
PROVISIONING_CERTIFICATE_BASE64: ${{ secrets.IOS_DISTRIBUTION_PROVISIONING_PROFILE }} | |
run: | | |
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision | |
echo -n "$PROVISIONING_CERTIFICATE_BASE64" | base64 --decode --output $PP_PATH | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles | |
- name: Install and set Flutter version | |
uses: subosito/flutter-action@v1 | |
- name: Restore packages | |
run: flutter pub get | |
- name: Build Flutter | |
run: flutter build ios --release --no-codesign | |
- run: | | |
ls ios/ | |
cat ios/Podfile | |
- name: Build resolve Swift dependencies | |
run: xcodebuild -resolvePackageDependencies -workspace ios/Runner.xcworkspace -scheme Runner -configuration Release | |
- name: Build xArchive | |
run: | | |
xcodebuild -workspace ios/Runner.xcworkspace -scheme Runner -configuration Release DEVELOPMENT_TEAM=Y26953UNR3 -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath build-output/app.xcarchive PROVISIONING_PROFILE=b3e19150-67f0-45cb-a9cc-79cd874dce5e clean archive CODE_SIGN_IDENTITY="iPhone Distribution: Andre Schle (Y26953UNR3)" | |
- name: Export ipa | |
run: xcodebuild -exportArchive -archivePath build-output/app.xcarchive -exportPath build-output/ios -exportOptionsPlist ios/ExportOptions.plist | |
- uses: papeloto/action-zip@v1 | |
with: | |
files: build-output/ios | |
dest: volt_campaigner-ios.zip | |
- name: Publish iOS Artefacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: release-ios | |
path: volt_campaigner-ios.zip | |
release: | |
runs-on: ubuntu-latest | |
needs: [version, windows, linux, web, mac, android] | |
steps: | |
- uses: actions/[email protected] | |
with: | |
name: version | |
path: version | |
- uses: actions/[email protected] | |
with: | |
name: volt_campaigner-windows | |
path: windows/volt_campaigner-windows.zip | |
- uses: actions/[email protected] | |
with: | |
name: volt_campaigner-linux | |
path: linux/volt_campaigner-linux.zip | |
- uses: actions/[email protected] | |
with: | |
name: volt_campaigner-web | |
path: web/volt_campaigner-web.zip | |
- uses: actions/[email protected] | |
with: | |
name: volt_campaigner-android | |
path: android/volt_campaigner-android.apk | |
- uses: actions/[email protected] | |
with: | |
name: volt_campaigner-mac | |
path: mac/volt_campaigner-mac.zip | |
# - uses: actions/[email protected] | |
# with: | |
# name: release-ios | |
# path: ios/volt_campaigner-ios.zip | |
- run: | | |
chmod 755 mac/volt_campaigner-mac.zip | |
- run: | | |
ls version/ | |
version_number=$(cat version/version.yml | sed 's/\(---\|major: \|minor: \|patch: \|\)//g' | sed -z 's/\n/./g;s/,$/\n/' | sed 's/^\.//g') | |
echo "${version_number}" | |
echo "version_number=${version_number}" >> $GITHUB_ENV | |
echo "${{ env.version_number }}" | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ env.version_number }}" | |
title: "Release ${{ env.version_number }}" | |
files: | | |
windows/volt_campaigner-windows.zip | |
linux/volt_campaigner-linux.zip | |
web/volt_campaigner-web.zip | |
mac/volt_campaigner-mac.zip | |
ios/volt_campaigner-ios.zip | |
android/volt_campaigner-android.apk |