-
Notifications
You must be signed in to change notification settings - Fork 5
96 lines (96 loc) · 3.2 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Release
on:
push:
branches:
- main
- beta
jobs:
js:
name: Release (JS)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "lts/*"
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run semantic-release
dart:
# The `semantic-release` from JS calculates the version tag
needs: js
if: ${{ github.ref_name == 'main' }}
name: Release (dart)
# https://dart.dev/tools/pub/automated-publishing
permissions:
id-token: write # This is required for requesting the JWT
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46
- run: dart pub get
working-directory: ./dart
- run: dev/dart/generate
- run: dart test
working-directory: ./dart
- name: Set Tag
run: |
TAG=`echo $(git describe --tags --abbrev=0)`
echo "GIT_TAG=${TAG#v}" >> $GITHUB_ENV
- run: dev/dart/prepublish
env:
RELEASE_VERSION: ${{ env.GIT_TAG }}
- name: Verify pubspec
run: cat ./dart/pubspec.yaml
# - run: dart pub publish --force
# working-directory: ./dart
# We can't actually publish to pub.dev from this workflow.
# pub.dev requires the action be triggered by a "tag" (not "branch") push.
# See https://github.com/dart-lang/pub-dev/blob/master/app/lib/package/backend.dart#L1255
# Manual Workaround: (after this workflow completes on a clean checkout)
# $ dev/dart/generate
# $ RELEASE_VERSION=#.#.# dev/dart/prepublish
# $ dart pub publish --force
# TODO: find safer way to automate
kotlin:
# The `semantic-release` from JS calculates the version tag
needs: js
if: ${{ github.ref_name == 'main' }}
name: Release (Kotlin)
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Generate protobufs
run: dev/kotlin/generate
- name: Run build with Gradle Wrapper
run: ./gradlew build
- name: Set Tag
run: |
TAG=`echo $(git describe --tags --abbrev=0)`
echo "GIT_TAG=${TAG#v}" >> $GITHUB_ENV
- name: Gradle Publish
env:
RELEASE_VERSION: ${{ env.GIT_TAG }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
SIGN_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
SIGN_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
MAVEN_PROFILE_ID: ${{ secrets.MAVEN_PROFILE_ID }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository