-
Notifications
You must be signed in to change notification settings - Fork 122
47 lines (44 loc) · 1.54 KB
/
dispatch-release.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
name: Dispatch release
on:
workflow_dispatch:
inputs:
release-tag:
type: string
description: release-tag
permissions: write-all
jobs:
dispatch-release:
environment: release
runs-on: ubuntu-latest
steps:
- uses: RDXWorks-actions/checkout@main
- name: create pull request
run: gh pr create -B ${BASE_BRANCH} -H ${CURRENT_BRANCH} --title 'Merge release into main' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_BRANCH: main
CURRENT_BRANCH: ${{ github.ref_name }}
continue-on-error: true
- name: Update Version
run: |
if [[ $VERSION_NUMBER =~ ^v[0-9]+\.[0-9]+ ]]; then
echo "Tag ${VERSION_NUMBER}"
echo "Cargo Version ${VERSION_NUMBER:1}"
else
echo "Something is wrong with your version" >&2
echo "Make sure your version is in semantic versioning format and starts with a v" >&2
exit -1
fi
./update-cargo-toml-versions.sh ${VERSION_NUMBER:1}
git config --global user.name 'Radix Bot'
git config --global user.email '[email protected]'
git add .
git commit -m "Update version to ${VERSION_NUMBER:1}"
git push
# gh release create ${VERSION_NUMBER} --notes "Release from dispatch" --prerelease
git tag ${VERSION_NUMBER}
git push --tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION_NUMBER: ${{ inputs.release-tag }}
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}