-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (86 loc) · 3.26 KB
/
release.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
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
97
98
99
name: Release Automation
on:
workflow_dispatch:
inputs:
version-bump:
description: The scale of the version bump required for semver compatibility
required: true
default: patch
type: choice
options:
- patch
- minor
- major
concurrency: release
env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx4096m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 --no-daemon
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ANDROID_SIGNING_GPG }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ANDROID_SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}
jobs:
release:
name: Release Bindings for Kotlin, Swift & Typescript
runs-on: ubuntu-latest
steps:
- name: 🧮 Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
- uses: actions/setup-node@v3
with:
cache: "yarn"
- name: 🗜️ Setup
run: "./scripts/setup.sh"
- name: 🔨 Generate json
run: "./scripts/generateJson.sh"
- name: 👊 Bump yarn version
run: |
yarn version --no-git-tag-version --${{ github.event.inputs.version-bump }}
- name: 👊 Set the version in env
run: |
echo "NEW_VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV
- name: 👊 Sync the version with android
run: |
./scripts/update_android_version.sh ${{ env.NEW_VERSION }}
- name: 👊 Commit the version
run: |
git config --global user.name 'ElementRobot'
git config --global user.email '[email protected]'
git commit -am "${{ github.event.inputs.version-bump }} version bump"
git push
- name: 🛠️ Setup Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
- name: ⬆️ Publish to Sonatype
uses: gradle/gradle-build-action@v2
with:
build-root-directory: platforms/android
arguments: publishAllPublicationsToMavenCentral
- name: 🚀 Close staging repo and release version
uses: gradle/gradle-build-action@v2
with:
build-root-directory: platforms/android
arguments: closeAndReleaseRepository
- name: 🚀 Publish to npm
id: npm-publish
uses: JS-DevTools/npm-publish@5a85faf05d2ade2d5b6682bfe5359915d5159c6c # v2.2.1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
ignore-scripts: false
- name: 🧬 Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.NEW_VERSION }}
release_name: Release ${{ env.NEW_VERSION }}
body: ${{ env.NEW_VERSION }} Release
draft: false
prerelease: false