Start a new release #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Start a new release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Tag to be created, in the form X.Y.Z" | |
required: true | |
type: string | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if organization member | |
id: is_organization_member | |
uses: JamesSingleton/[email protected] | |
with: | |
organization: Giskard-AI | |
username: ${{ github.actor }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Interrupt job | |
if: ${{ steps.is_organization_member.outputs.result == 'false' }} | |
shell: bash | |
run: | | |
echo "Job failed due to user not being a member of Giskard-AI organization and the 'safe for build' label not being set on the PR" | |
exit 1 | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
fetch-tags: true | |
ref: main | |
token: ${{ secrets.RELEASE_PAT_TOKEN }} # Needed to trigger other actions | |
- name: Edit pyproject.toml | |
run: sed -i 's/^\(version *= *\).*$/\1"${{ inputs.version }}"/' pyproject.toml | |
- name: Configure git | |
run: | | |
git config --global user.name 'BotReleaser' | |
git config --global user.email '[email protected]' | |
- name: Adding file | |
run: | | |
git add pyproject.toml | |
git commit -m "v${{ inputs.version }}" --allow-empty | |
git tag v${{ inputs.version }} | |
- name: Push to main and tags | |
run: | | |
git push origin main | |
git push origin v${{ inputs.version }} |