-
Notifications
You must be signed in to change notification settings - Fork 3.7k
195 lines (182 loc) · 6.55 KB
/
cli-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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# This defines a workflow to build and release a new version of the aptos CLI.
# In order to trigger it go to the Actions Tab of the Repo, click "Release CLI" and then "Run Workflow".
name: "Release CLI"
on:
workflow_dispatch:
inputs:
release_version:
type: string
required: true
description: "The release version. E.g. `0.2.3`:"
source_git_ref_override:
type: string
required: false
description: "GIT_SHA_OVERRIDE: Use this to override the Git SHA1, branch name (e.g. devnet) or tag to build the binaries from. Defaults to the workflow Git REV, but can be different than that:"
dry_run:
type: boolean
required: false
default: true
description: "Dry run - If checked, the release will not be created"
jobs:
# TODO: Deprecated, only supports OpenSSL v1, which is deprecated.
build-ubuntu20-binary:
name: "Build Ubuntu 20.04 binary"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.source_git_ref_override }}
- uses: aptos-labs/aptos-core/.github/actions/rust-setup@main
- name: Build CLI
run: scripts/cli/build_cli_release.sh "Ubuntu" "${{inputs.release_version}}"
- name: Upload Binary
uses: actions/upload-artifact@v4
with:
name: cli-builds-ubuntu-20.04
path: aptos-cli-*.zip
# TODO: Deprecated, please use "Linux" instead as it's more straightforwardly named
build-ubuntu22-binary:
name: "Build Ubuntu 22.04 binary"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.source_git_ref_override }}
- uses: aptos-labs/aptos-core/.github/actions/rust-setup@main
- name: Build CLI
run: scripts/cli/build_cli_release.sh "Ubuntu-22.04" "${{inputs.release_version}}"
- name: Upload Binary
uses: actions/upload-artifact@v4
with:
name: cli-builds-ubuntu-22.04
path: aptos-cli-*.zip
build-linux-binary:
name: "Build Linux binary"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.source_git_ref_override }}
- uses: aptos-labs/aptos-core/.github/actions/rust-setup@main
- name: Build CLI
run: scripts/cli/build_cli_release.sh "Linux" "${{inputs.release_version}}"
- name: Upload Binary
uses: actions/upload-artifact@v4
with:
name: cli-builds-linux
path: aptos-cli-*.zip
build-linux-arm-binary:
name: "Build Linux ARM binary"
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.source_git_ref_override }}
- uses: aptos-labs/aptos-core/.github/actions/rust-setup@main
- name: Build CLI
run: scripts/cli/build_cli_release.sh "Linux" "${{inputs.release_version}}"
- name: Upload Binary
uses: actions/upload-artifact@v4
with:
name: cli-builds-linux-arm
path: aptos-cli-*.zip
# build-macos-x86_64-binary:
# name: "Build MacOS x86_64 binary"
# runs-on: macos-13
# steps:
# - uses: actions/checkout@v4
# with:
# ref: ${{ github.event.inputs.source_git_ref_override }}
# - uses: aptos-labs/aptos-core/.github/actions/rust-setup@main
# with:
# macos: true
# - name: Build CLI
# run: scripts/cli/build_cli_release.sh "macOS" "${{inputs.release_version}}"
# - name: Upload Binary
# uses: actions/upload-artifact@v4
# with:
# name: cli-builds-macos-x86-64
# path: aptos-cli-*.zip
# build-macos-arm-binary:
# name: "Build MacOS ARM binary"
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v4
# with:
# ref: ${{ github.event.inputs.source_git_ref_override }}
# - uses: aptos-labs/aptos-core/.github/actions/rust-setup@main
# with:
# macos: true
# - name: Build CLI
# run: scripts/cli/build_cli_release.sh "macOS" "${{inputs.release_version}}"
# - name: Upload Binary
# uses: actions/upload-artifact@v4
# with:
# name: cli-builds-macos-arm
# path: aptos-cli-*.zip
build-windows-binary:
name: "Build Windows binary"
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.source_git_ref_override }}
# Ensure that long paths work
- name: Ensure long paths work
run: git config --system core.longpaths true
shell: bash
- name: Build CLI
run: scripts\cli\build_cli_release.ps1
- name: Upload Binary
uses: actions/upload-artifact@v4
with:
name: cli-builds-windows
path: aptos-cli-*.zip
release-binaries:
name: "Release binaries"
needs:
- build-ubuntu20-binary
- build-ubuntu22-binary
- build-windows-binary
- build-linux-binary
- build-linux-arm-binary
# - build-macos-arm-binary
# - build-macos-x86_64-binary
runs-on: ubuntu-latest
permissions:
contents: "write"
pull-requests: "read"
if: ${{ inputs.dry_run }} == 'false'
steps:
- name: Download prebuilt binaries
uses: actions/download-artifact@v4
with:
pattern: cli-builds-*
merge-multiple: true
- name: Create GitHub Release
uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # [email protected]
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ format('aptos-cli-v{0}', inputs.release_version) }}"
prerelease: false
title: "${{ format('Aptos CLI Release v{0}', inputs.release_version) }}"
files: |
aptos-cli-*.zip
bump-homebrew-version-pr:
name: "Make PR to bump version in Homebrew"
needs:
- release-binaries
runs-on: ubuntu-latest
steps:
- uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: aptos
tag-name: "${{ format('aptos-cli-v{0}', inputs.release_version) }}"
base-branch: master
create-pullrequest: true
commit-message: |
{{formulaName}} {{version}}
Created by https://github.com/mislav/bump-homebrew-formula-action
From CLI release run ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
env:
COMMITTER_TOKEN: ${{ secrets.APTOS_BOT_GH_PAT_APTOS_CORE_HOMEBREW_BUMPER }}