forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 24
133 lines (125 loc) · 4.64 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
# This defines a workflow to build and release a new version of the Movement 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: false
description: "Dry run - If checked, the release will not be created"
push:
branches:
- andygolay/movement-cli-release
jobs:
set-defaults:
runs-on: ubuntu-latest
outputs:
release_version: ${{ steps.set-defaults.outputs.release_version }}
source_git_ref_override: ${{ steps.set-defaults.outputs.source_git_ref_override }}
dry_run: ${{ steps.set-defaults.outputs.dry_run }}
steps:
- name: Set default values
id: set-defaults
run: |
echo "::set-output name=release_version::v3.5.1 || 'default-release-version' }}"
echo "::set-output name=source_git_ref_override::${{ github.event.inputs.source_git_ref_override || github.sha }}"
echo "::set-output name=dry_run::${{ github.event.inputs.dry_run || 'false' }}"
build-ubuntu20-binary:
name: "Build Ubuntu 20.04 binary"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.source_git_ref_override }}
- uses: movementlabsxyz/aptos-core/.github/actions/rust-setup@andygolay/movement-cli-release
- name: Build CLI
run: scripts/cli/build_cli_release.sh "Ubuntu"
- name: Upload Binary
uses: actions/upload-artifact@v3
with:
name: cli-builds
path: movement-cli-*.zip
build-ubuntu22-binary:
name: "Build Ubuntu 22.04 binary"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.source_git_ref_override }}
- uses: movementlabsxyz/aptos-core/.github/actions/rust-setup@andygolay/movement-cli-release
- name: Build CLI
run: scripts/cli/build_cli_release.sh "Ubuntu-22.04"
- name: Upload Binary
uses: actions/upload-artifact@v3
with:
name: cli-builds
path: movement-cli-*.zip
# build-windows-binary:
# name: "Build Windows binary"
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# with:
# ref: ${{ github.event.inputs.source_git_ref_override }}
# - name: Build CLI
# run: scripts\cli\build_cli_release.ps1
# - name: Upload Binary
# uses: actions/upload-artifact@v3
# with:
# name: cli-builds
# path: movement-cli-*.zip
release-binaries:
name: "Release binaries"
needs:
- build-ubuntu20-binary
- build-ubuntu22-binary
# - build-windows-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@v3
with:
name: cli-builds
- name: Create GitHub Release
uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # pin@v1.2.1
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ format('movement-cli-v{0}', inputs.release_version) }}"
prerelease: false
title: "${{ format('Movement CLI Release v{0}', inputs.release_version) }}"
files: |
movement-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 }}