-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (54 loc) · 1.7 KB
/
Copy pathrelease.yml
File metadata and controls
54 lines (54 loc) · 1.7 KB
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
name: Release
on:
workflow_dispatch:
inputs:
ref:
description: 'Github Ref'
required: false
default: 'main'
version:
description: 'Version (without "v" prefix)'
required: true
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Run Tests
shell: bash
run: ./test.sh
- name: Tag
if: success()
run: |
git config user.name "$GIT_USERNAME" && git config user.email "$GIT_EMAIL"
git tag -a "v$RELEASE_VERSION" -m "Release v$RELEASE_VERSION created by @$GITHUB_ACTOR"
git push origin --tags
env:
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
RELEASE_VERSION: ${{ github.event.inputs.version }}
- name: Generate Changelog
if: success()
uses: heinrichreimer/github-changelog-generator-action@v2.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
output: CHANGELOG.md
usernamesAsGithubLogins: true
stripGeneratorNotice: true
- name: Create Release
if: success()
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ format('v{0}', steps.setup.outputs.RELEASE_VERSION) }}
release_name: ${{ format('{0}@v{1}', github.repository, github.event.inputs.version) }}
body_path: CHANGELOG.md
draft: true
prerelease: false