Skip to content

update tempate

update tempate #42

Workflow file for this run

name: Release
jobs:
pages-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- uses: pdm-project/setup-pdm@c050bdcb2405837648035b6678c75609d53a749f # v4
with:
cache: true
python-version: '3.12'
- id: pages
name: Setup pages
uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0
- run: env | sort
- run: PDM_NO_EDITABLE=true make dev-doc
- run: CI_PAGES_URL=${{ steps.pages.outputs.base_url }} make doc
- name: Generate release notes
run: make release-notes > release-notes.md
- name: Upload release notes
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: release-notes
path: release-notes.md
- name: Upload pages artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: public
release-publish:
needs: pages-build
permissions:
contents: write
runs-on: ubuntu-22.04
steps:
- name: Download release notes
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: release-notes
- id: prerelease
name: Determine prerelease
run: |
if [[ "${{ github.ref }}" =~ (a|b|rc)(0|[1-9][0-9]*)?$ ]]; then
echo "is_prerelease=true" > $GITHUB_OUTPUT
else
echo "is_prerelease=false" > $GITHUB_OUTPUT
fi
- name: Create GitHub release
uses: softprops/action-gh-release@d99959edae48b5ffffd7b00da66dcdb0a33a52ee # v2.0.2
with:
body_path: release-notes.md
prerelease: ${{ steps.prerelease.outputs.is_prerelease }}
container-publish:
needs: release-publish
permissions:
packages: write
runs-on: ubuntu-22.04
steps:
- uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c # v3.1.0
- uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
- name: Build and push dev container
env:
SOURCE_DATE_EPOCH: 0
uses: docker/build-push-action@af5a7ed5ba88268d5278f7203fb52cd833f66d6e # v5.2.0
with:
build-args: |
PYTHON_VERSION=${{ matrix.python-version }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/dev-cache:py${{ matrix.python-version }}
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/dev-cache:py${{ matrix.python-version }},mode=max
file: .devcontainer/Dockerfile
provenance: false
push: true
tags: |
ghcr.io/${{ github.repository }}/dev:py${{ matrix.python-version }}
ghcr.io/${{ github.repository }}/dev:py${{ matrix.python-version }}-${{ github.ref_name }}
target: dev
- name: Build and push prod container
env:
SOURCE_DATE_EPOCH: 0
uses: docker/build-push-action@af5a7ed5ba88268d5278f7203fb52cd833f66d6e # v5.2.0
with:
build-args: |
PYTHON_VERSION=${{ matrix.python-version }}
PDM_BUILD_SCM_VERSION=${{ github.ref_name }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/dev-cache:py${{ matrix.python-version }}
file: .devcontainer/Dockerfile
provenance: false
push: true
tags: |
ghcr.io/${{ github.repository }}:py${{ matrix.python-version }}
ghcr.io/${{ github.repository }}:py${{ matrix.python-version }}-${{ github.ref_name }}
target: prod
strategy:
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
package-publish:
needs: release-publish
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: pdm-project/setup-pdm@c050bdcb2405837648035b6678c75609d53a749f # v4
with:
cache: true
python-version: '3.12'
- run: env | sort
- env:
PDM_PUBLISH_PASSWORD: ${{ secrets.PDM_PUBLISH_PASSWORD }}
PDM_PUBLISH_USERNAME: ${{ vars.PDM_PUBLISH_USERNAME || '__token__' }}
run: make publish
pages:
needs: release-publish
permissions:
id-token: write
pages: write
runs-on: ubuntu-22.04
steps:
- id: deployment
name: Deploy to GitHub Pages
uses: actions/deploy-pages@decdde0ac072f6dcbe43649d82d9c635fff5b4e4 # v4.0.4
on:
push:
tags:
- v?[0-9]+.[0-9]+.[0-9]+
- v?[0-9]+.[0-9]+.[0-9]+-?a[0-9]*
- v?[0-9]+.[0-9]+.[0-9]+-?b[0-9]*
- v?[0-9]+.[0-9]+.[0-9]+-?rc[0-9]*