Skip to content

.github/workflows/publish-release.yml #7

.github/workflows/publish-release.yml

.github/workflows/publish-release.yml #7

Workflow file for this run

name: publish-and-release
on:
push:
branches:
- master
tags:
- "**" # TODO: improve this match or use semver validation
jobs:
# main.yml is ignored when pushing tags (aka, publish-releasing).
# Then, it is called here to assure pipeline consistency.
# main-ci:
# name: Main CI
# uses: ./.github/workflows/main.yml
# secrets: inherit
build-and-test-dist:
name: Build and Test distribution
runs-on: ubuntu-latest
# needs: main-ci
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Prepare build environemnt
run: |
chmod +x .github/scripts/dist-health-check.sh
pip install --user python-minifier wheel setuptools
- name: Build distribution
run: make dist
- name: Check dist health
run: .github/scripts/dist-health-check.sh
- name: Save dist files
uses: actions/upload-artifact@v3
with:
name: dist-folder
path: dist
pypi-publish:
name: Upload release to PyPI
needs: build-and-test-dist
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/<your-pypi-project-name>
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Get dist
uses: actions/download-artifact@v3
with:
name: dist-folder
- name: Publish package distributions to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
run: echo "Publishing to PyPI"
github-release:
name: Create GitHub Release
needs: build-and-test-dist
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
- name: Install git-changelog
run: pip install git-changelog
- name: Prepare release notes
run: |
git-changelog --release-notes > release-notes.md
echo "Release notes being used:"
cat release-notes.md
- name: Create GitHub release
# uses: softprops/action-gh-release@v1
# with:
# body_path: release-notes.md
run: echo "Publishing GH release"
netlify-publish:
name: Publish documentation to Netlify
runs-on: ubuntu-latest
needs: build-and-test-dist
steps:
- name: Publish to netlify
run: echo "Publishing docs to Netlify"