Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add release workflow updates to production branch #1873

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 33 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Release Workflow

on:
release:
types:
- created
push:
branches:
- production

concurrency:
group: release_workflow
Expand All @@ -15,7 +15,28 @@ env:
WEB_APP_ENV: ${{ vars.WEB_APP_ENV }}

jobs:
create_release:
name: "Tagged Release"
runs-on: "ubuntu-latest"
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get Version from pubspec.yaml
run: echo "VERSION=$(grep '^version:' pubspec.yaml | cut -d ' ' -f2 | tr -d '\r')" >> $GITHUB_ENV
- name: Create GitHub Release
id: create_release
uses: ncipollo/release-action@v1
with:
name: Release v${{ env.VERSION }}
tag: ${{ env.VERSION }}
draft: false
prerelease: false
generateReleaseNotes: true

build_web:
needs: create_release
runs-on: ubuntu-latest
environment: production
steps:
Expand Down Expand Up @@ -63,12 +84,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: pangeachat-web.tar.gz
asset_name: pangeachat-web.tar.gz
asset_content_type: application/gzip

build_apk:
needs: create_release
runs-on: ubuntu-latest
environment: production
env:
Expand Down Expand Up @@ -120,15 +142,16 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/app/outputs/apk/release/app-release.apk
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build/app/outputs/flutter-apk/app-release.apk
asset_name: pangeachat.apk
asset_content_type: application/vnd.android.package-archive
build_linux:
strategy:
matrix:
arch: [ x64, arm64 ]
runs-on: ${{ matrix.arch == 'arm64' && 'self-hosted' || 'ubuntu-latest'}}
arch: [ x64 ]
runs-on: ubuntu-latest
needs: create_release
steps:
- uses: actions/checkout@v4
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
Expand All @@ -149,7 +172,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: pangeachat-linux-${{ matrix.arch }}.tar.gz
asset_name: pangeachat-linux-${{ matrix.arch }}.tar.gz
asset_content_type: application/gzip
Expand Down Expand Up @@ -179,4 +202,4 @@ jobs:
aws s3 sync ./build/web s3://$WEBAPP_S3_BUCKET
- name: AWS CloudFront Invalidation
run: |
aws cloudfront create-invalidation --distribution-id $CF_DISTRIBUTION_ID --paths "/*"
aws cloudfront create-invalidation --distribution-id $CF_DISTRIBUTION_ID --paths "/*"
Loading