fix: yaml indentation #2
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: Release Action | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
Release: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
concurrency: release | |
steps: | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: 3.8 | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Check release status | |
id: release-status | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
pip install python-semantic-release | |
if semantic-release --noop --strict version | |
then | |
echo "Releasing new version." | |
else | |
echo "Skipping release step." | |
fi | |
- if: steps.release-status.outputs.released == 'true' | |
name: Release to GitHub | |
id: github-release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
semantic-release version --no-vcs-release | |
git fetch --tags | |
VERSION="${{ steps.release-status.outputs.tag }}" | |
MAJOR=${VERSION%%.*} | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
git tag -fa ${MAJOR} -m "Update major version tag" | |
git push origin ${MAJOR} --force |