-
Notifications
You must be signed in to change notification settings - Fork 101
57 lines (51 loc) · 1.65 KB
/
release-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
name: Open a release PR
on:
workflow_dispatch:
inputs:
version:
description: Version to release
required: true
type: string
env:
RUSTUP_MAX_RETRIES: 10
jobs:
make-release-pr:
runs-on: ubuntu-latest
strategy:
matrix:
package: [neptune]
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
- name: Get current version
id: get-version
run: |
echo "CURRENT_VERSION=$(./script/get_current_version.sh ${{ matrix.package }})" >> $GITHUB_ENV
- name: Check version
id: version-check
run: |
IFS='.' read -ra INPUT_VERSION <<< "${{ github.event.inputs.version }}"
IFS='.' read -ra CURRENT_VERSION <<< "${{ env.CURRENT_VERSION }}"
for i in "${!INPUT_VERSION[@]}"; do
if (( INPUT_VERSION[i] > CURRENT_VERSION[i] )); then
echo "Input version is larger than current version. Proceeding..."
exit 0
elif (( INPUT_VERSION[i] < CURRENT_VERSION[i] )); then
echo "Input version is not larger than current version. Failing..."
exit 1
fi
done
echo "Input version is equal to current version. Failing..."
exit 1
- name: Install cargo-release
uses: taiki-e/install-action@v2
with:
tool: cargo-release
- uses: cargo-bins/release-pr@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ inputs.version }}
pr-template-file: .github/release-pr-template.ejs
crate-name: "neptune"