Skip to content

Commit 988c63d

Browse files
authored
chore: Add GitHub publishing workflows (#964)
<!-- Thanks for contributing! Provide a description of your changes below and a general summary in the title Please look at the following checklist to ensure that your PR can be accepted quickly: --> ## Description Adds the possibility to publish from GitHub. ## Type of Change <!--- Put an `x` in all the boxes that apply: --> - [ ] ✨ `feat` -- New feature (non-breaking change which adds functionality) - [ ] 🛠️ `fix` -- Bug fix (non-breaking change which fixes an issue) - [ ] ❌ `!` -- Breaking change (fix or feature that would cause existing functionality to change) - [ ] 🧹 `refactor` -- Code refactor - [x] ✅ `ci` -- Build configuration change - [ ] 📝 `docs` -- Documentation - [ ] 🗑️ `chore` -- Chore
1 parent 47982d9 commit 988c63d

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Prepare release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
prerelease:
6+
description: 'Version as prerelease'
7+
required: false
8+
default: false
9+
type: boolean
10+
11+
jobs:
12+
prepare-release:
13+
name: Prepare release
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- uses: subosito/flutter-action@v2
23+
- uses: bluefireteam/melos-action@v3
24+
with:
25+
run-versioning: ${{ inputs.prerelease == false }}
26+
run-versioning-prerelease: ${{ inputs.prerelease == true }}
27+
publish-dry-run: true
28+
create-pr: true
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish packages
2+
on:
3+
# Enable to also publish, when pushing a tag
4+
#push:
5+
# tags:
6+
# - '*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish-packages:
11+
name: Publish packages
12+
permissions:
13+
contents: write
14+
id-token: write # Required for authentication using OIDC
15+
runs-on: [ ubuntu-latest ]
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: subosito/flutter-action@v2
21+
- uses: bluefireteam/melos-action@v3
22+
with:
23+
publish: true
24+

.github/workflows/release-tag.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Tag release
2+
on:
3+
push:
4+
branches: [main]
5+
6+
jobs:
7+
publish-packages:
8+
name: Create tags for release
9+
permissions:
10+
actions: write
11+
contents: write
12+
runs-on: [ ubuntu-latest ]
13+
if: contains(github.event.head_commit.message, 'chore(release)')
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- uses: subosito/flutter-action@v2
19+
- uses: bluefireteam/melos-action@v3
20+
with:
21+
tag: true
22+
- run: |
23+
melos exec -c1 --no-published --no-private --order-dependents -- \
24+
gh workflow run release-publish.yml \
25+
--ref \$MELOS_PACKAGE_NAME-v\$MELOS_PACKAGE_VERSION
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+

0 commit comments

Comments
 (0)