-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
59 lines (48 loc) · 1.49 KB
/
release.yml
File metadata and controls
59 lines (48 loc) · 1.49 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
55
56
57
58
59
name: release
on:
workflow_dispatch:
inputs:
version:
description: 'The version to create the release for.'
required: true
type: string
permissions: {}
jobs:
release:
runs-on: [ ubuntu-latest ]
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:
contents: write
issues: write
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
filter: 'tree:0'
persist-credentials: false
show-progress: false
- name: Create release
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
VERSION: ${{ inputs.version }}
with:
script: |
const { repo, owner } = context.repo;
const draft = true;
let version = process.env.VERSION;
if (version.startsWith('v')) {
version = version.slice(1);
}
const { data: release } = await github.rest.repos.createRelease({
owner,
repo,
tag_name: version,
target_commitish: process.env.DEFAULT_BRANCH,
name: version,
draft,
generate_release_notes: true,
});
core.notice(`Created release ${release.name}: ${release.html_url}`);