-
Notifications
You must be signed in to change notification settings - Fork 9
49 lines (44 loc) · 1.39 KB
/
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
48
name: Create release
on:
workflow_dispatch:
inputs:
version:
required: true
description: Ex. 1.2.0
permissions:
contents: write
jobs:
create-release:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TZ: 'Asia/Tokyo'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Audit version
run: |
expect_version=$(sed -n 's/.*kVersion = "\(.*\)";/\1/p' smctemp.h)
input_version=${{ github.event.inputs.version }}
if [[ "$expect_version" != "$input_version" ]]; then
echo "ERROR: Version is mismatched. Expected version: $expect_version"
exit 1
fi
- name: Set version and create tag
run: |
VERSION=${{ github.event.inputs.version }}
echo "Creating tag $VERSION"
git config --global user.name 'narugit'
git config --global user.email '[email protected]'
git tag -a $VERSION -m "Version $VERSION"
git push origin $VERSION
- name: Create release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
draft: false
prerelease: false