Skip to content

release

release #40

Workflow file for this run

name: release
on:
workflow_run:
workflows: ["CI"]
types:
- completed
branches:
- main
# push:
# branches:
# - main
jobs:
tag:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip3 install poetry
- name: Python Semantic Release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Store the release tag
id: release_version
run: |
echo "release_version=$(poetry version --short)" >> $GITHUB_ENV
outputs:
release_version: ${{ env.release_version }}
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
needs: tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: v${{ needs.tag.outputs.release_version }}
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install build dependencies
run: |
pip3 install poetry
- name: Build
run: poetry build
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: salt-gnupg-rotate
path: dist/*
if-no-files-found: error
- name: Upload Artifacts to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/*
file_glob: true
tag: v${{ needs.tag.outputs.release_version }}
overwrite: true
docs-build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
needs: tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: v${{ needs.tag.outputs.release_version }}
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip3 install poetry nox nox-poetry
- name: Build the standalone documentation
run: |
nox -s docs-build --force-color
- name: Create standalone documentation zip
working-directory: docs/_build
run: |
zip -r salt-gnupg-rotate-${{ needs.tag.outputs.release_version }}-documentation.zip .*
- name: Upload Artifacts to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: docs/_build/*-documentation.zip
file_glob: true
tag: v${{ needs.tag.outputs.release_version }}
overwrite: true