Skip to content

Commit

Permalink
Try create-release workflow again
Browse files Browse the repository at this point in the history
  • Loading branch information
manics committed Sep 18, 2022
1 parent 0707856 commit 38d83f1
Showing 1 changed file with 15 additions and 26 deletions.
41 changes: 15 additions & 26 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,29 @@
name: release-tag
on:
push:
# tags:
# - "**"

# jobs:
# create-release:
# runs-on: ubuntu-latest
# permissions:
# contents: write
# steps:
# # https://github.com/actions/github-script
# - uses: actions/github-script@v6
# with:
# # https://octokit.github.io/rest.js/v18#repos-create-release
# script: |
# github.rest.repos.createRelease({
# owner: context.repo.owner,
# repo: context.repo.repo,
# tag_name: github.ref_name,
# prerelease: !github.ref_name.match(/\d+\.\d+\.\d+$/),
# body: 'Please see the [changelog](https://zero-to-jupyterhub.readthedocs.io/en/latest/changelog.html) for details.'
# });

tags:
- "**"

jobs:
debug:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# https://github.com/actions/github-script
# https://octokit.github.io/rest.js/v18#repos-create-release
- uses: actions/github-script@v6
with:
script: |
console.log(context)
if (!context.ref.startsWith('refs/tags/')) {
core.setFailed(`${context.ref} is not in the form refs/tags/$tag`)
}
let tag = context.ref.slice(10)
console.log(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.'
});

0 comments on commit 38d83f1

Please sign in to comment.