diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml index b7ddd06..6c80dfb 100644 --- a/.github/workflows/release-tag.yml +++ b/.github/workflows/release-tag.yml @@ -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) \ No newline at end of file + 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.' + });