diff --git a/.github/workflows/pre_release.yaml b/.github/workflows/pre_release.yaml index 3d3f4bd3..fd0a5e40 100644 --- a/.github/workflows/pre_release.yaml +++ b/.github/workflows/pre_release.yaml @@ -1,4 +1,4 @@ -name: Build and Release Pre-Release +name: Pre-Release OpenHIIT run-name: Creating pre-release 🚀 diff --git a/.github/workflows/build_and_release.yaml b/.github/workflows/release.yaml similarity index 80% rename from .github/workflows/build_and_release.yaml rename to .github/workflows/release.yaml index 5fb3c4a4..9be3a22b 100644 --- a/.github/workflows/build_and_release.yaml +++ b/.github/workflows/release.yaml @@ -1,45 +1,22 @@ -name: Build and Release Flutter App +name: Release OpenHIIT -run-name: ${{ github.actor }} is building Android and iOS releases 🚀 +run-name: ${{ github.actor }} is creating a new release 🚀 on: workflow_dispatch: push: - branches: - - main - paths: - - VERSION - tags-ignore: - - "*" + tags: + - 'v*.*.*' + - '!*-beta' jobs: - GetVersionNumber: - runs-on: ubuntu-latest - permissions: - contents: read - outputs: - version: ${{ steps.version.outputs.content }} - steps: - - uses: actions/checkout@v3 - - - name: Read file - id: version - uses: juliangruber/read-file-action@v1.1.6 - with: - path: VERSION - - - name: Print version - run: echo ${{ steps.version.outputs.content }} - BuildAndroidRelease: runs-on: ubuntu-latest environment: production - needs: GetVersionNumber permissions: contents: write - # Steps represent a sequence of tasks that will be executed as part of the job steps: - uses: actions/checkout@v3 @@ -51,11 +28,9 @@ jobs: cache: 'gradle' check-latest: true - # Checkout the repository code and get packages. - name: Checkout app code uses: actions/checkout@v3 - # Set up Flutter. - uses: subosito/flutter-action@v1 with: channel: "stable" @@ -103,11 +78,9 @@ jobs: permissions: contents: write steps: - # Checks-out our repository under $GITHUB_WORKSPACE, so our job can access it - name: Checkout repository uses: actions/checkout@v3 - # Set up Flutter. - uses: subosito/flutter-action@v1 with: channel: "stable" @@ -145,11 +118,9 @@ jobs: EXPORT_OPTS_PATH=$RUNNER_TEMP/ExportOptions.plist echo -n "$EXPORT_OPTIONS_PLIST" | base64 --decode -o $EXPORT_OPTS_PATH - # Build and sign the ipa using a single flutter command - name: Building IPA run: flutter build ipa --release --export-options-plist=$RUNNER_TEMP/ExportOptions.plist - - # Collect the file and upload as artifact + - name: Upload IPA Artifact uses: actions/upload-artifact@v3 with: @@ -164,7 +135,7 @@ jobs: CreateDraftRelease: runs-on: ubuntu-latest - needs: [BuildAndroidRelease, BuildiOSRelease, GetVersionNumber] + needs: [BuildAndroidRelease, BuildiOSRelease] permissions: contents: write steps: @@ -188,6 +159,7 @@ jobs: uses: ncipollo/release-action@v1.13.0 with: artifacts: "app-release.aab, app-release.apk, workout_timer.ipa" - draft: "true" - tag: ${{needs.GetVersionNumber.outputs.version}} - generateReleaseNotes: "true" + draft: true + tag: ${{ github.ref_name }} + generateReleaseNotes: true + skipIfReleaseExists: true