Skip to content

chore: weekly ClinVar release 20240716 (#92) #89

chore: weekly ClinVar release 20240716 (#92)

chore: weekly ClinVar release 20240716 (#92) #89

Workflow file for this run

name: Release
defaults:
run:
# cf. https://github.com/mamba-org/provision-with-micromamba#important
shell: bash -l {0}
on:
push:
branches:
- main
jobs:
Create-Release:
runs-on: ubuntu-latest
outputs:
is-release: ${{ steps.check-release.outputs.is-release }}
release-name: ${{ steps.check-release.outputs.release-name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Check whether we are on a release commit
id: check-release
run: |
set -euo pipefail
set -x
msg=$(git log -1 --pretty=%B | head -n 1)
if [[ "$msg" == "chore: weekly ClinVar release "* ]]; then
echo "This is a release commit."
echo is-release=true >> $GITHUB_OUTPUT
# The full name of the weekly release, includes the dash after the year.
echo release-name=$(cat release-name.txt || echo 00-latest_weekly) >> $GITHUB_OUTPUT
# The release name without the dash after the year.
echo release-name=$((cat release-name.txt || echo 00-latest_weekly) | tr -d '-') >> $GITHUB_OUTPUT
else
echo "This is not a release commit."
echo is-release=false >> $GITHUB_OUTPUT
fi
- name: Create release
if: steps.check-release.outputs.is-release == 'true'
run: |
tag=clinvar-weekly-$RELEASE_NAME
if ! git tag | grep $tag >/dev/null; then
git tag -a $tag -m "Auto-release of weekly ClinVar $RELEASE_NAME"
git push --tags
fi
if ! gh release list | grep $tag >/dev/null; then
gh release create clinvar-weekly-$RELEASE_NAME \
--title=clinvar-weekly-$RELEASE_NAME \
--verify-tag \
--draft=true \
--notes "This release was created automatically by GitHub Action in our CI."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: ${{ steps.check-release.outputs.release-name }}
Publish-Artifacts:
needs:
- Create-Release
if: needs.Create-Release.outputs.is-release == 'true'
uses: ./.github/workflows/-build-artifacts.yml
secrets: inherit
with:
publish-artifacts: ${{ needs.Create-Release.outputs.is-release }}
release-name: ${{ needs.Create-Release.outputs.release-name }}
workflow-name: release.yml
Publish-Release:
runs-on: ubuntu-latest
needs:
- Create-Release
- Publish-Artifacts
if: needs.Create-Release.outputs.is-release == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Mark release as published
run: |
set -euo pipefail
set -x
gh release edit clinvar-weekly-$RELEASE_NAME \
--draft=false \
--discussion-category=Announcements
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: ${{ needs.Create-Release.outputs.release-name }}