forked from jupyterhub/zero-to-jupyterhub-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (30 loc) · 1.03 KB
/
release-tag.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
# Create a GitHub release whenever a tag is pushed.
# Tags that aren't in the form N.N.N are considered pre-releases.
name: release-tag
on:
push:
tags:
- "**"
jobs:
create-release:
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
# https://github.com/actions/github-script
# https://octokit.github.io/rest.js/v18#repos-create-release
- uses: actions/github-script@v7
with:
script: |
if (!context.ref.startsWith('refs/tags/')) {
core.setFailed(`${context.ref} is not in the form refs/tags/$tag`)
}
const tag = context.ref.slice(10)
const prerelease = !tag.match(/\d+\.\d+\.\d+$/)
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: tag,
prerelease: prerelease,
body: 'Please see the [changelog](https://zero-to-jupyterhub.readthedocs.io/en/latest/changelog.html) for details.'
});