Release on tag #13
Workflow file for this run
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 on tag | |
on: | |
push: | |
tags: | |
- "*" | |
workflow_dispatch: | |
inputs: | |
version: | |
description: The tag to check out | |
required: true | |
jobs: | |
# test: | |
# uses: ./.github/workflows/tests.yaml | |
getversion: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.get_version.outputs.pkgVersion }} | |
steps: | |
- name: Get version | |
id: get_version | |
run: | | |
version="" | |
if [ "${{ github.event_name }}" == "workflow_dispatch" ] | |
then | |
version="${{ github.event.inputs.version }}" | |
else | |
version="$GITHUB_REF_NAME" | |
fi | |
echo "pkgVersion=$version" >> $GITHUB_OUTPUT | |
echo "Version: $version" | |
build: | |
needs: [getversion] # ,test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ needs.getversion.outputs.version }} | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
- name: Install dependencies | |
run: | | |
python -m pip install .[dist] | |
- name: Build | |
run: | | |
python -m build | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: packages | |
path: | | |
dist/screen_brightness_control*.whl | |
dist/screen_brightness_control*.tar.gz | |
# release: | |
# needs: [build] | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Download artifact | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: packages | |
# - name: Draft release | |
# uses: softprops/action-gh-release@v1 | |
# with: | |
# draft: true | |
# files: "dist/*" | |
# name: "${{ needs.getversion.outputs.version }}" | |
# tag_name: ${{ needs.getversion.outputs.version }} | |
docs: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ needs.getversion.outputs.version }} | |
- name: Checkout docs | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: docs/docs | |
- name: Generate docs | |
run: | | |
make docs | |
- name: Configure Git | |
working-directory: docs/docs | |
run: | | |
git config --global user.name "Github Actions [Bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY | |
- name: Commit and Push | |
working-directory: docs/docs | |
run: | | |
git add -A | |
git commit -m "Bump ${{ needs.getversion.outputs.version }}" | |
git push |