Skip to content

Commit 6231452

Browse files
authored
feat: update gh actions to use node 24 (#199)
* ci: Add automated publishing to pub.dev * bump actions
1 parent 572b864 commit 6231452

3 files changed

Lines changed: 96 additions & 13 deletions

File tree

.github/pull_request_template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
- [ ] 📋 Changelog updated
1313
- [ ] ➡️ `pubspec.yaml` version updated
1414

15+
# dSYMs:
16+
- [ ] attached
17+
1518
<!-- Check all tasks. Can be done after merge. -->
1619
## Post-release checklist
1720
- [ ] 🐦 Release to pub.dev

.github/workflows/flutter-ci.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ on:
55
branches:
66
- master
77
paths-ignore:
8-
- '**/*.md'
9-
- '.github/**'
8+
- "**/*.md"
9+
- ".github/**"
1010
pull_request:
1111
branches:
1212
- master
1313
paths-ignore:
14-
- '**/*.md'
15-
- '.github/**'
14+
- "**/*.md"
15+
- ".github/**"
1616

1717
workflow_dispatch:
1818

@@ -25,10 +25,10 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: 📚 Git Checkout
28-
uses: actions/checkout@v4
28+
uses: actions/checkout@v6
2929

3030
- name: 🐦 Setup Flutter
31-
uses: subosito/flutter-action@v2.16.0
31+
uses: subosito/flutter-action@v2
3232
with:
3333
channel: stable
3434
flutter-version: ${{ env.FLUTTER_VERSION }}
@@ -53,10 +53,10 @@ jobs:
5353
needs: lint
5454
steps:
5555
- name: 📚 Git Checkout
56-
uses: actions/checkout@v4
56+
uses: actions/checkout@v6
5757

5858
- name: 🐦 Setup Flutter
59-
uses: subosito/flutter-action@v2.16.0
59+
uses: subosito/flutter-action@v2
6060
with:
6161
channel: stable
6262
flutter-version: ${{ env.FLUTTER_VERSION }}
@@ -68,13 +68,13 @@ jobs:
6868
build-android:
6969
runs-on: ubuntu-latest
7070
needs: test
71-
71+
7272
steps:
7373
- name: 📚 Git Checkout
74-
uses: actions/checkout@v4
74+
uses: actions/checkout@v6
7575

7676
- name: 🐦 Setup Flutter
77-
uses: subosito/flutter-action@v2.16.0
77+
uses: subosito/flutter-action@v2
7878
with:
7979
channel: stable
8080
flutter-version: ${{ env.FLUTTER_VERSION }}
@@ -90,10 +90,10 @@ jobs:
9090

9191
steps:
9292
- name: 📚 Git Checkout
93-
uses: actions/checkout@v4
93+
uses: actions/checkout@v6
9494

9595
- name: 🐦 Setup Flutter
96-
uses: subosito/flutter-action@v2.16.0
96+
uses: subosito/flutter-action@v2
9797
with:
9898
channel: stable
9999
flutter-version: ${{ env.FLUTTER_VERSION }}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Publish release
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- master
8+
push:
9+
tags:
10+
- "v*"
11+
12+
permissions:
13+
contents: write
14+
id-token: write
15+
16+
jobs:
17+
release_gh:
18+
name: GitHub Release
19+
if: github.event_name == 'push' || (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release'))
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: 📚 Git Checkout
23+
uses: actions/checkout@v6
24+
25+
- name: Get latest version
26+
run: |
27+
echo "PACKAGE_VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r')" >> $GITHUB_ENV
28+
29+
- name: Download dSYMs
30+
if: github.event_name == 'pull_request'
31+
env:
32+
PR_BODY: ${{ github.event.pull_request.body }}
33+
run: |
34+
url=$(echo "$PR_BODY" | grep -oE 'https://[^ )]*dSYMs\.zip' | head -n 1)
35+
if [ -n "$url" ]; then
36+
echo "Found dSYMs URL: $url"
37+
curl -L -o dSYMs.zip "$url"
38+
else
39+
echo "No dSYMs.zip URL found in PR body."
40+
fi
41+
42+
- name: Generate Changelog
43+
run: awk '/^## \[/{if (f) exit; f=1; next} f' CHANGELOG.md > RELEASE_NOTES.md
44+
45+
- name: GitHub Release
46+
env:
47+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
run: |
49+
FILES=""
50+
if [ -f dSYMs.zip ]; then
51+
FILES="dSYMs.zip"
52+
fi
53+
gh release create v${{ env.PACKAGE_VERSION }} \
54+
--title "freeRASP ${{ env.PACKAGE_VERSION }}" \
55+
--notes-file RELEASE_NOTES.md \
56+
$FILES
57+
58+
publish_pub_dev:
59+
name: Publish release to pub.dev
60+
needs: release_gh
61+
runs-on: ubuntu-latest
62+
steps:
63+
- name: 📚 Git Checkout
64+
uses: actions/checkout@v6
65+
66+
- name: 🐦 Setup Flutter
67+
uses: subosito/flutter-action@v2
68+
with:
69+
channel: stable
70+
flutter-version: 3.24.0
71+
cache: true
72+
73+
- name: 🎯 Setup Pub Credentials
74+
uses: dart-lang/setup-dart@v1
75+
76+
- name: 📦 Install Dependencies
77+
run: flutter pub get
78+
79+
- name: 🚀 Publish to pub.dev
80+
run: flutter pub publish -f

0 commit comments

Comments
 (0)