-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.17 KB
/
release.yml
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
48
name: release
on:
push:
tags:
- "v*"
jobs:
github-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Determine if prerelease"
id: check-prerelease
run: |
RELEASE_TAG=${GITHUB_REF#refs/tags/}
if [[ "${RELEASE_TAG}" =~ "v.*-.*" ]]; then
IS_PRERELEASE="true"
else
IS_PRERELEASE="false"
fi
echo "::set-output name=is-prerelease::${IS_PRERELEASE}"
- uses: softprops/action-gh-release@v1
with:
prerelease: ${{ steps.check-prerelease.outputs.is-prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pubdev-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dart-lang/setup-dart@v1
- name: "Install credentials file"
run: |
mkdir -p ~/.pub-cache
echo "${{ secrets.PUBDEV_CREDENTIAL_JSON_B64 }}" \
| base64 --decode > ~/.pub-cache/credentials.json
- name: "Dry run publish to pub.dev"
run: dart pub publish --dry-run
- name: "Publish to pub.dev"
run: dart pub publish --force