-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.22 KB
/
publish-draft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: publish
on:
push:
tags: # trigger the publish job on tag creation
- "*"
jobs:
test:
uses: ./.github/workflows/browser-tests.yaml
publish_github_release:
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ncipollo/release-action@v1
with:
bodyFile: "RELEASE.md"
publish_pub_dev:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Dart
uses: dart-lang/setup-dart@v1
- name: Append GITHUB_RUN_NUMBER to version
run: |
VERSION=$(grep 'version:' pubspec.yaml | cut -d ' ' -f 2)
echo "Current version: $VERSION"
NEW_VERSION="$VERSION+${GITHUB_RUN_NUMBER}"
echo "New version: $NEW_VERSION"
sed -i "s/version: $VERSION/version: $NEW_VERSION/g" pubspec.yaml
cat pubspec.yaml
- name: Dry run publish package
run: dart pub publish --dry-run # Perform a dry run first
#- name: Publish package
# run: |
# dart pub publish --force --token ${{ secrets.PUB_TOKEN }}
deploy:
needs: publish_pub_dev
uses: ./.github/workflows/deploy.yaml