Skip to content

Commit

Permalink
Update and rename build.yml to build-and-release-snapshots.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dclipca authored Apr 11, 2024
1 parent 5abced8 commit da10a31
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 72 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/build-and-release-snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build and Release Flutter Application

on: [push, pull_request]

jobs:
setup:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.flutter-action.outputs.CACHE-KEY }}
cache-path: ${{ steps.flutter-action.outputs.CACHE-PATH }}

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Set up Flutter
uses: subosito/flutter-action@v2
id: flutter-action
with:
channel: stable
cache: true

build-and-release:
needs: setup
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
artifact-name: "Windows-Snapshot"
build-command: "flutter build windows"
- os: ubuntu-latest
artifact-name: "Linux-Snapshot"
build-command: "flutter build linux"
- os: macos-latest
artifact-name: "macOS-Snapshot"
build-command: "flutter build macos"
steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache-key: ${{ needs.setup.outputs.cache-key }}
cache-path: ${{ needs.setup.outputs.cache-path }}

- name: Build
run: ${{ matrix.build-command }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_number }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: true

- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./path/to/your/build/${{ matrix.artifact-name }}
asset_name: ${{ matrix.artifact-name }}.zip
asset_content_type: application/zip
72 changes: 0 additions & 72 deletions .github/workflows/build.yml

This file was deleted.

0 comments on commit da10a31

Please sign in to comment.