From 97b7671a8a44f985fbf9fbff80a493be4aeeda2c Mon Sep 17 00:00:00 2001 From: Martin Kim <46072231+martinkim0@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:38:29 -0700 Subject: [PATCH] ci: add release workflow (#291) * feat: update dev module tutorial for lossoutput * ci: add release workflow --- .github/workflows/release.yaml | 54 ++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..e261c83 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,54 @@ +name: release + +on: + workflow_dispatch: + inputs: + tag: + description: "The version to tag (without the leading 'v'). If omitted, will initiate a dry run (no uploads)." + default: "" + type: string + prerelease: + description: "Whether the release is a pre-release." + default: false + type: boolean + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + tag-release: + name: Tag release + runs-on: ubuntu-latest + needs: validate-tag + # If you don't set an input tag, it's a dry run (no uploads). + if: ${{ inputs.tag }} + permissions: + # For git tag + contents: write + steps: + - uses: actions/checkout@v4 + - name: git tag + run: | + git config --global user.email "martin.kim@scverse.org" + git config --global user.name "scvi-tools release" + git tag -m "${{ inputs.tag }}" "${{ inputs.tag }}" + git push --tags + + publish-release: + name: Publish to GitHub + runs-on: ubuntu-latest + needs: tag-release + # If you don't set an input tag, it's a dry run (no uploads). + if: ${{ inputs.tag }} + permissions: + # For GitHub release publishing + contents: write + steps: + - uses: actions/checkout@v4 + - uses: softprops/action-gh-release@v2 + with: + name: ${{ inputs.tag }} + tag_name: ${{ inputs.tag }} + generate_release_notes: true + prerelease: ${{ inputs.prerelease }}