forked from argumentcomputer/zk-light-clients
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (84 loc) · 3.35 KB
/
bump-version-PR.yml
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
# Workflow to create a new release PR, with one of the following two scenarios:
#
# - Major release
# - Pushes a new `release/<tag-prefix>-v<version>` branch based on latest default branch
# - Creates a new `release-pr` branch from the release, then bumps the version with the `version` input
# - Opens a release PR from `release-pr` to `release/<tag-prefix>-v<version>`
# - Minor release
# - Pushes a new `release/<tag-prefix>-v<version>` branch based on the latest compatible major release
# - Creates a new `release-pr` branch from the release, then bumps the version with the `version` input
# - Opens a release PR from `release-pr` to `release/<tag-prefix>-v<version>`
# - Patch release
# - Pushes a new `patch/<tag-prefix>-v<version>` branch based on `release/<tag-prefix>-v<version>`, then bumps the verision with the `version` input
# - Errors if the `release/<tag-prefix>-v<version>` branch doesn't exist
# - Opens a release PR from `patch/<tag-prefix>-v<version>` to `release/<tag-prefix>-v<version>`
#
# When the PR is merged, the caller can then automatically trigger a release from `ci-workflows/actions/tag-release`
# The PR branch can then be safely deleted, while the release branch should have a branch protection rule for historical preservation
name: Create release PR
on:
workflow_dispatch:
inputs:
light-client:
description: 'Light client to release'
type: choice
options:
- aptos
- ethereum
- kadena
required: true
default: 'aptos'
release-type:
description: 'Semver release type'
required: true
default: 'major'
type: choice
options:
- major
- minor
- patch
version:
description: '`<major>.<minor>.<patch>` version, e.g. `1.0.0`'
required: true
type: string
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Git config
run: |
git config --global user.name "argument-ci[bot]"
git config --global user.email "argument-ci[bot]@users.noreply.github.com"
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/checkout@v4
with:
repository: argumentcomputer/ci-workflows
path: ci-workflows
ref: release-workflow
- name: Add `programs/` subcrates to release
run: |
if [[ "${{ inputs.light-client }}" == "aptos" ]]; then
MORE_CRATES="programs/inclusion,programs/epoch-change"
elif [[ "${{ inputs.light-client }}" == "ethereum" ]]; then
MORE_CRATES="programs/inclusion,programs/committee-change"
else
#MORE_CRATES="programs/longest-chain"
MORE_CRATES=""
fi
echo "MORE_CRATES=$MORE_CRATES" | tee -a $GITHUB_ENV
# - uses: tibdex/github-app-token@v2
# id: generate-token
# with:
# app_id: ${{ secrets.TOKEN_APP_ID }}
# private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }}
- name: Open release PR
uses: ./ci-workflows/.github/actions/release-pr
with:
tag-prefix: ${{ inputs.light-client }}
path: ${{ inputs.light-client }}
more-crates: ${{ env.MORE_CRATES }}
release-type: ${{ inputs.release-type }}
version: ${{ inputs.version }}
token: ${{ secrets.REPO_TOKEN }}