-
Notifications
You must be signed in to change notification settings - Fork 483
110 lines (107 loc) · 3.47 KB
/
release.yml
File metadata and controls
110 lines (107 loc) · 3.47 KB
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
100
101
102
103
104
105
106
107
108
109
110
name: Release
permissions:
id-token: write
contents: read
on:
push:
branches: [main]
jobs:
check-release:
runs-on: ubuntu-latest
outputs:
will-publish: ${{ steps.check.outputs.will-publish }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check for pending changesets
id: check
run: |
CHANGESETS=$(find .changeset -name "*.md" -not -name "README.md" | wc -l | tr -d ' ')
if [ "$CHANGESETS" -eq 0 ]; then
echo "will-publish=true" >> $GITHUB_OUTPUT
else
echo "will-publish=false" >> $GITHUB_OUTPUT
fi
build-android:
needs: check-release
if: needs.check-release.outputs.will-publish == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: "false"
- name: Setup project
uses: ./.github/actions/setup-project
with:
node-cache: ""
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Build Android native library
run: bash ./scripts/build-native-lib.sh android
- name: Upload Android artifacts
uses: actions/upload-artifact@v4
with:
name: android-artifacts
path: packages/async-storage/android/local_repo
build-apple:
needs: check-release
if: needs.check-release.outputs.will-publish == 'true'
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: "false"
- name: Setup project
uses: ./.github/actions/setup-project
with:
node-cache: ""
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Build Apple native library
run: bash ./scripts/build-native-lib.sh apple
- name: Upload Apple artifacts
uses: actions/upload-artifact@v4
with:
name: apple-artifacts
path: packages/async-storage/apple-frameworks
release:
runs-on: ubuntu-latest
needs: [check-release, build-android, build-apple]
if: "!failure() && !cancelled()"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: "false"
- name: Setup project
uses: ./.github/actions/setup-project
- name: Install dependencies
run: yarn
- name: Download Android artifacts
if: needs.check-release.outputs.will-publish == 'true'
uses: actions/download-artifact@v4
with:
name: android-artifacts
path: packages/async-storage/android/local_repo
- name: Download Apple artifacts
if: needs.check-release.outputs.will-publish == 'true'
uses: actions/download-artifact@v4
with:
name: apple-artifacts
path: packages/async-storage/apple-frameworks
- name: Version or release packages
uses: changesets/action@v1
with:
title: "release: version packages"
commit: "release: version packages"
setupGitUser: "false"
publish: "yarn release:publish"
version: "yarn release:version"
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
GITHUB_NAME: ${{ vars.GH_BOT_NAME }}
GITHUB_EMAIL: ${{ vars.GH_BOT_EMAIL }}
NPM_TOKEN: "" # https://github.com/changesets/changesets/issues/1152#issuecomment-3765490009
NPM_CONFIG_PROVENANCE: true