forked from lerlar/developer-tooling
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (103 loc) · 3.63 KB
/
release.yaml
File metadata and controls
112 lines (103 loc) · 3.63 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
111
112
name: Release Packages
on:
push:
branches:
- master
- hotfixes
- feat/release-13
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Open Release PR or Publish Packages
permissions:
contents: write
actions: read
pull-requests: write
security-events: write
attestations: write
id-token: write
repository-projects: write
uses: celo-org/reusable-workflows/.github/workflows/npm-publish.yaml@v3.0.0
with:
node-version: 20
version-command: yarn version-then-update-files
publish-command: yarn release
# release gives an array of published packages as json objects, we need an array of strings for installing
prepare:
name: Format Output for Install
if: needs.release.outputs.published == 'true'
needs: release
runs-on: ['self-hosted', 'org', 'ubuntu-22-04']
container:
image: node:20-bullseye
outputs:
result: '${{ steps.map.outputs.output }}'
steps:
- name: Install jq
uses: dcarbone/install-jq-action@v3.0.1
- name: Format Published Packages Array
uses: cloudposse/github-action-jq@main
id: map
with:
compact: true
raw-output: true
input: '${{ needs.release.outputs.publishedPackages }}'
script: |-
map("\(.name)@\(.version)")
# last line of defense to ensure that the packages were published correctly
install-released-packages:
name: Install Released Packages
needs: [prepare, release]
outputs:
assetStableCLIRelease: ${{ steps.assertStableVersion.outcome }}
if: needs.release.outputs.published == 'true' && needs.prepare.outputs.result
runs-on: ['self-hosted', 'org', 'ubuntu-22-04']
container:
image: node:20-bullseye
strategy:
fail-fast: false
max-parallel: 12
matrix:
package: ${{fromJson(needs.prepare.outputs.result)}}
steps:
- name: Install @celo/celocli dependencies
if: contains(matrix.package, '@celo/celocli')
run: |
apt update
apt install -y libusb-1.0-0-dev libudev-dev
npm install node-gyp --global
- name: Installing ${{ matrix.package }} package
run: npm install ${{ matrix.package }} --global
- name: Ensure sample of celocli commands run
if: contains(matrix.package, '@celo/celocli')
run: |
celocli --version
celocli account:new
echo "checking celo community fund balance"
celocli account:balance 0xD533Ca259b330c7A88f74E000a3FaEa2d63B7972 --node celo
celocli network:whitelist --node alfajores
- name: Checkout Repo
if: contains(matrix.package, '@celo/celocli')
uses: actions/checkout@v4
with:
sparse-checkout: |
scripts
- name: Is stable celocli release
id: assertStableVersion
if: contains(matrix.package, '@celo/celocli')
continue-on-error: true
run: |
version=$(echo "${{ matrix.package }}" | cut -d "@" -f3)
./scripts/assert_stable_version "$version"
open-docs-pr:
needs: [install-released-packages]
if: ${{ needs.install-released-packages.outputs.assetStableCLIRelease != 'failure' }}
uses: celo-org/developer-tooling/.github/workflows/open-docs-pr.yml@master
with:
commit: ${{ github.sha }}
upload-executables:
needs: [install-released-packages]
if: ${{ needs.install-released-packages.outputs.assetStableCLIRelease != 'failure' }}
uses: celo-org/developer-tooling/.github/workflows/upload-celocli-executables.yml@master
with:
ref: ${{ github.sha }}