Tinkering with workflows #6
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: publish | ||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
# - 'src/rfscopedb/__version__.py' | ||
- 'VERSION' | ||
jobs: | ||
# release: | ||
# uses: jeffersonlab/python-workflows/.github/workflows/gh-release.yaml@v3 | ||
# | ||
# docs_publish: | ||
# needs: | ||
# - release | ||
# uses: jeffersonlab/python-workflows/.github/workflows/gh-pages-publish.yaml@v3 | ||
# with: | ||
# semvertag: ${{ needs.release.outputs.semvertag }} | ||
release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
- semvertag: ${{ steps.getver.outputs.semvertag }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Build | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[dev] | ||
- name: Build | ||
run: | | ||
python -m build | ||
sphinx-build -b html docsrc/source build/docs | ||
- name: Read version file | ||
id: getver | ||
run: | | ||
VER=$(cat VERSION) | ||
echo "VERSION=v$VER" >> $GITHUB_ENV | ||
echo "semvertag=v$VER" >> $GITHUB_OUTPUT | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
generate_release_notes: true | ||
tag_name: ${{ env.VERSION }} | ||
# files: ${{ inputs.files }} | ||
publish: | ||
needs: | ||
- release | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: docs | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[dev] | ||
- name: Build | ||
run: | | ||
python -m build | ||
sphinx-build -b html docsrc/source build/docs | ||
- name: Deploy Docs | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: build/docs | ||
target-folder: ${{ needs.release.outputs.semvertag }} |