-
Notifications
You must be signed in to change notification settings - Fork 97
69 lines (69 loc) · 2.85 KB
/
force-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
name: Force release libsbp
on:
workflow_dispatch:
inputs:
major:
description: 'Semver major label'
required: true
minor:
description: 'Semver minor label'
required: true
patch:
description: 'Semver patch label'
required: true
env:
MAJOR: ${{ github.event.inputs.major }}
MINOR: ${{ github.event.inputs.minor }}
PATCH: ${{ github.event.inputs.patch }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Echo inputs
run: |
echo "major: ${{ github.event.inputs.major }}"
echo "minor: ${{ github.event.inputs.minor }}"
echo "patch: ${{ github.event.inputs.patch }}"
echo "v$MAJOR.$MINOR.$PATCH"
- uses: actions/checkout@v2
- name: Update C version
run: |
sed -i "s/define SBP_VERSION_MAJOR .*/define SBP_VERSION_MAJOR $MAJOR/" c/include/libsbp/version.h
sed -i "s/define SBP_VERSION_MINOR .*/define SBP_VERSION_MINOR $MINOR/" c/include/libsbp/version.h
sed -i "s/define SBP_VERSION_PATCH .*/define SBP_VERSION_PATCH $PATCH/" c/include/libsbp/version.h
sed -i "s/define SBP_VERSION \".*\"/define SBP_VERSION \"$MAJOR.$MINOR.$PATCH\"/" c/include/libsbp/version.h
- name: Update Haskell version
run: |
sed -i "s/version: .*/version: $MAJOR.$MINOR.$PATCH/" haskell/sbp.cabal
- name: Update Javascript version
run: |
echo "$MAJOR.$MINOR.$PATCH" > javascript/sbp/RELEASE-VERSION
sed -i "s/\"version\": \".*\"/\"version\": \"$MAJOR.$MINOR.$PATCH\"/" package.json
sed -i "s/\"version\": \".*\"/\"version\": \"$MAJOR.$MINOR.$PATCH\"/" package-lock.json
- name: Update Python version
run: |
echo "$MAJOR.$MINOR.$PATCH" > python/sbp/RELEASE-VERSION
- name: Update Rust version
run: |
sed -i "s/version = \".*\"/version = \"$MAJOR.$MINOR.$PATCH\"/" rust/sbp/Cargo.toml
sed -i "s/version = \".*\"/version = \"$MAJOR.$MINOR.$PATCH-unreleased\"/" rust/sbp2json/Cargo.toml
- name: Update PDF
run: echo "TODO"
- name: Commit changes
run: |
git checkout -b "force-release-v$MAJOR.$MINOR.$PATCH"
git add .
git status
git commit -m "force release v$MAJOR.$MINOR.$PATCH"
git push --set-upstream origin "force-release-v$MAJOR.$MINOR.$PATCH"
- name: Create PR
uses: peter-evans/create-pull-request@v3
with:
token: ${{ env.GITHUB_TOKEN }}
commit-message: "chore: force release v$MAJOR.$MINOR.$PATCH"
title: "chore: force release v$MAJOR.$MINOR.$PATCH"
body: "chore: force release v$MAJOR.$MINOR.$PATCH"
branch: "force-release-v$MAJOR.$MINOR.$PATCH"
base: "master"
branch-suffix: "force-release-v$MAJOR.$MINOR.$PATCH"
delete-branch: true