Skip to content

Create Pre-release

Create Pre-release #5

Workflow file for this run

name: Create Pre-release
on:
workflow_dispatch:
jobs:
prerelease:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get package info
shell: bash
id: package-info
run: echo "version=$(python scripts/get_package_version.py)" >> $GITHUB_OUTPUT
- name: 'Find Release with tag v${{ steps.package-info.outputs.version}}'
uses: actions/github-script@v7
id: release-exists
env:
APP_VERSION: ${{ steps.package-info.outputs.version}}
with:
script: |
const releases = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo
})
const tagName = `v${process.env.APP_VERSION}`
const releaseWithTag = releases.data.find(release => release.tag_name === tagName)
return releaseWithTag ? 'true' : 'false'
result-encoding: string
- name: Create pre-release
uses: softprops/action-gh-release@v1
if: steps.release-exists.outputs.result == 'false'
with:
token: ${{ secrets.JLAB_APP_TOKEN }}
body: '## JupyterLab Desktop v${{ steps.package-info.outputs.version}}'
draft: false
prerelease: true
tag_name: 'v${{ steps.package-info.outputs.version}}'