Skip to content

Bump actions/upload-artifact from 5 to 6 #227

Bump actions/upload-artifact from 5 to 6

Bump actions/upload-artifact from 5 to 6 #227

Workflow file for this run

on:
push
name: Build, Release
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
- name: Build Linux
run: flutter build linux --release
- name: List files
run: ls -R build/linux/x64
- name: Create artifact
uses: actions/upload-artifact@v6
with:
name: visualtimer_linux
path: build/linux/x64/release/bundle/
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
- run: flutter pub get
- run: dart run flutter_launcher_icons
- name: Bundle Secrets
run: |
echo "${{ secrets.UPLOAD_KEYSTORE }}" > android/upload-keystore.jks.asc
gpg -d --passphrase='${{ secrets.UPLOAD_KEYSTORE_PASSPHRASE }}' --batch android/upload-keystore.jks.asc > android/app/upload-keystore.jks
echo 'storePassword=${{ secrets.UPLOAD_KEYSTORE_PASSPHRASE }}' > android/keystore.properties
echo 'keyPassword=${{ secrets.UPLOAD_KEYSTORE_PASSPHRASE }}' >> android/keystore.properties
echo 'keyAlias=${{ secrets.UPLOAD_KEYSTORE_KEYALIAS }}' >> android/keystore.properties
echo 'storeFile=upload-keystore.jks' >> android/keystore.properties
- name: Build Bundle
run: flutter build appbundle --release
- name: Bundle Cert Hash
run: 'keytool -printcert -jarfile build/app/outputs/bundle/release/app-release.aab | grep SHA1: '
- name: APK Secrets
run: |
echo "${{ secrets.ANDROID_KEYSTORE }}" > android/keystore.jks.asc
gpg -d --passphrase='${{ secrets.ANDROID_KEYSTORE_PASSPHRASE }}' --batch android/keystore.jks.asc > android/app/keystore.jks
echo 'storePassword=${{ secrets.ANDROID_KEYSTORE_PASSPHRASE }}' > android/keystore.properties
echo 'keyPassword=${{ secrets.ANDROID_KEYSTORE_PASSPHRASE }}' >> android/keystore.properties
echo 'keyAlias=${{ secrets.ANDROID_KEYSTORE_KEYALIAS }}' >> android/keystore.properties
echo 'storeFile=keystore.jks' >> android/keystore.properties
- name: Build APK
run: flutter build apk --release
- name: APK Cert Hash
run: 'keytool -printcert -jarfile build/app/outputs/flutter-apk/app-release.apk | grep SHA1: '
- name: List files
run: ls -R build/app/outputs/flutter-apk ; ls -R build/app/outputs/bundle
- name: Create Bundle artifact
uses: actions/upload-artifact@v6
with:
name: visualtimer_bundle
path: build/app/outputs/bundle/release/app-release.aab
- name: Create APK artifact
uses: actions/upload-artifact@v6
with:
name: visualtimer_apk
path: build/app/outputs/flutter-apk/app-release.apk
build-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter pub get
- run: flutter build web --release --base-href "/visualtimer/"
- name: List files
run: ls -R build/web
- name: Create artifact
uses: actions/upload-artifact@v6
with:
name: visualtimer_web
path: build/web/
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
channel: 'beta'
- run: flutter build windows --release
- name: List files
run: ls -R build/windows
- name: Create artifact
uses: actions/upload-artifact@v6
with:
name: visualtimer_windows
path: build\windows\x64\runner\Release
release:
runs-on: ubuntu-latest
needs: [
build-linux,
build-windows,
build-android,
build-web
]
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v6
with:
path: artifacts
- name: Display artifacts
run: ls -R artifacts
- name: Zip linux
run: cd artifacts/visualtimer_linux; zip -r ../visualtimer_linux.zip ./
- name: Zip windows
run: cd artifacts/visualtimer_linux; zip -r ../visualtimer_windows.zip ./
- uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
files: |
./artifacts/visualtimer_linux.zip
./artifacts/visualtimer_windows.zip
./artifacts/visualtimer_apk/app-release.apk
./artifacts/visualtimer_bundle/app-release.aab
- name: Deploy Web
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: artifacts/visualtimer_web
branch: gh-pages