-
Notifications
You must be signed in to change notification settings - Fork 11
40 lines (36 loc) · 1.32 KB
/
release-scripts.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
on:
workflow_dispatch:
inputs:
version:
type: string
required: true
description: "Version to release"
name: Release
jobs:
release_workflow:
runs-on: ubuntu-latest
steps:
- name: Step 1 - Checkout repository code
uses: actions/checkout@v4
with:
submodules: 'true'
fetch-depth: 0
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}
- name: Step 2 - Run release-scripts
env:
VERSION: ${{ inputs.version }}
GITHUB_TOKEN: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}
run: |
NEXT_VERSION="$(echo '${{ inputs.version }}' | perl -pe 's{^(([0-9]\.)+)?([0-9]+)$}{$1 . ($3 + 1)}e')"
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
./release-scripts/release.sh -v $VERSION $NEXT_VERSION
echo $(git log -5 --oneline)
git push --atomic origin master develop --follow-tags # all or nothing
- name: Step 3 - Create release notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="$(git describe --abbrev=0)"
echo $TAG
gh release create "$TAG" --repo="$GITHUB_REPOSITORY" --title="${GITHUB_REPOSITORY#*/} ${TAG#v}" --generate-notes