Skip to content

Commit

Permalink
Modify GitHub action to run only on releases
Browse files Browse the repository at this point in the history
Fixes #452

Add a new GitHub action to handle artifact upload during release events.

* Create `release-artifacts.yml` to run on `release` events.
* Add steps to build and upload artifacts for Android, macOS, Linux, and Windows.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/OWASP-BLT/BLT-Flutter/issues/452?shareId=XXXX-XXXX-XXXX-XXXX).
  • Loading branch information
DonnieBLT committed Oct 16, 2024
1 parent 6e1f072 commit 967622c
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions release-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release Artifacts

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
architecture: x64

- name: Get Flutter dependencies
run: flutter pub get

- name: Analyze Flutter code
run: flutter analyze

- name: Run Flutter tests
run: flutter test

- name: Build Android APK
run: flutter build apk

- name: Upload Android APK
uses: actions/upload-artifact@v2
with:
name: app-release-apk
path: build/app/outputs/flutter-apk/app-release.apk

- name: Build macOS application
run: flutter build macos

- name: Upload macOS application
uses: actions/upload-artifact@v2
with:
name: macos-release-app
path: build/macos/Build/Products/Release/*.app

- name: Build Linux application
run: flutter build linux

- name: Upload Linux application
uses: actions/upload-artifact@v2
with:
name: linux-release-app
path: build/linux/x64/release/bundle/*

- name: Build Windows application
run: flutter build windows

- name: Upload Windows application
uses: actions/upload-artifact@v2
with:
name: windows-release-app
path: build/windows/x64/runner/Release/*.exe

0 comments on commit 967622c

Please sign in to comment.