Skip to content

Manual Release

Manual Release #8

Workflow file for this run

name: Manual Release
env:
PYTHON_VERSION: '3.10'
on:
workflow_dispatch:
inputs:
release_token:
description: 'Your release token'
required: true
release_reason:
description: 'Short reason for this manual release'
required: true
# echo "Trick to echo GitHub Actions Secret: "
# echo ${{secrets.MARIE_CORE_RELEASE_TOKEN}} | sed 's/./& /g'
# echo ${{secrets.MARIE_DEV_BOT}} | sed 's/./& /g'
jobs:
token-check:
runs-on: ubuntu-latest
steps:
- name: Test with inputs
run: |
echo "The GitHub Action Secret will be masked: "
echo "Release reason : ${{ github.event.inputs.release_reason }}"
if [ "${{ github.event.inputs.release_token }}" != "${{ secrets.MARIE_CORE_RELEASE_TOKEN }}" ]; then
echo "Wrong release tokens"
exit 1
fi
- name: Check release token
id: token-check
run: |
echo "Checking release token"
touch SUCCESS
if: inputs.release_token == env.release_token
env:
release_token: ${{ secrets.MARIE_CORE_RELEASE_TOKEN }}
- name: Fail release token
run: |
[[ -f SUCCESS ]]
regular-release:
needs: [token-check]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.MARIE_DEV_BOT }}
fetch-depth: 100 # means max contribute history is limited to 100 lines
# submodules: true
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
# https://github.com/actions/checkout#fetch-all-tags
- run: |
echo "Checking release token"
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
npm install git-release-notes
pip install twine wheel
./scripts/release.sh final "${{ github.event.inputs.release_reason }}" "${{github.actor}}"
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
MARIE_SLACK_WEBHOOK : ${{ secrets.MARIE_SLACK_WEBHOOK }}
- if: failure()
run: echo "nothing to release"
- name: bumping master version
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.MARIE_DEV_BOT }}
tags: true
branch: ${{ github.ref }}