Skip to content

Commit

Permalink
ci: Release on tags that matches semantic version. (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan authored Sep 14, 2023
1 parent af95d62 commit 988f872
Show file tree
Hide file tree
Showing 10 changed files with 134 additions and 124 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/package.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/pages.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
cache: pip
python-version: '3.11'
- run: env | sort
- run: make dev-package
- run: make build
- env:
TWINE_NON_INTERACTIVE: true
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: ${{ vars.TWINE_USERNAME }}
run: make upload
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install git-changelog using pipx
run: pipx install git-changelog
- name: Prepare release notes
run: git-changelog --release-notes > release-notes.md
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
body_path: release-notes.md
prerelease: ${{ startsWith(github.ref, 'refs/tags/v0') }}
pages-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
cache: pip
python-version: '3.11'
- run: env | sort
- run: make dev-docs
- run: make docs
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: public
pages-deploy:
needs: build
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- id: deployment
name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2
name: Release
on:
push:
tags:
- v[1-9][0-9]*.[0-9]+.[0-9]+
- v0.[0-9]+.[0-9]+
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"pytest",
"Quickstart",
"setuptools",
"softprops",
"toctree",
"typer",
"unshallow"
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
A development-focused Python project template with various integrations, configurations and modules.

[![CI](https://github.com/serious-scaffold/serious-scaffold-python/actions/workflows/ci.yml/badge.svg)](https://github.com/serious-scaffold/serious-scaffold-python/actions/workflows/ci.yml)
[![Pages](https://github.com/serious-scaffold/serious-scaffold-python/actions/workflows/pages.yml/badge.svg)](https://github.com/serious-scaffold/serious-scaffold-python/actions/workflows/pages.yml)
[![Package](https://github.com/serious-scaffold/serious-scaffold-python/actions/workflows/package.yml/badge.svg)](https://github.com/serious-scaffold/serious-scaffold-python/actions/workflows/package.yml)
[![Release](https://github.com/serious-scaffold/serious-scaffold-python/actions/workflows/release.yml/badge.svg)](https://github.com/serious-scaffold/serious-scaffold-python/actions/workflows/release.yml)
[![Coverage](https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/serious-scaffold-python/reports/coverage/coverage_badge.json)](https://serious-scaffold.github.io/serious-scaffold-python/reports/coverage)
[![PyPI](https://img.shields.io/pypi/v/serious-scaffold)](https://pypi.org/project/serious-scaffold/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/serious-scaffold)](https://pypi.org/project/serious-scaffold/)
Expand Down
3 changes: 1 addition & 2 deletions includes/variable.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
[% macro pipeline_badge() -%]
[% if repo_host_type == 'github.com' -%]
[![CI](https://{{ repo_url() }}/actions/workflows/ci.yml/badge.svg)](https://{{ repo_url() }}/actions/workflows/ci.yml)
[![Pages](https://{{ repo_url() }}/actions/workflows/pages.yml/badge.svg)](https://{{ repo_url() }}/actions/workflows/pages.yml)
[![Package](https://{{ repo_url() }}/actions/workflows/package.yml/badge.svg)](https://{{ repo_url() }}/actions/workflows/package.yml)
[![Release](https://{{ repo_url() }}/actions/workflows/release.yml/badge.svg)](https://{{ repo_url() }}/actions/workflows/release.yml)
[%- elif repo_host_type == 'gitlab.com' or repo_host_type == 'gitlab-self-managed' -%]
[![pipeline status](https://{{ repo_url() }}/badges/main/pipeline.svg)](https://{{ repo_url() }}/-/commits/main)
[%- endif %]
Expand Down
1 change: 1 addition & 0 deletions template/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"pytest",
"Quickstart",
"setuptools",
"softprops",
"toctree",
"typer",
"unshallow"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
cache: pip
python-version: '{{ default_py }}'
- run: env | sort
- run: make dev-package
- run: make build
- env:
TWINE_NON_INTERACTIVE: true
TWINE_PASSWORD: {{ '${{ secrets.TWINE_PASSWORD }}' }}
TWINE_USERNAME: {{ '${{ vars.TWINE_USERNAME }}' }}
run: make upload
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install git-changelog using pipx
run: pipx install git-changelog
- name: Prepare release notes
run: git-changelog --release-notes > release-notes.md
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
body_path: release-notes.md
prerelease: {{ '${{ startsWith(github.ref, \'refs/tags/v0\') }}' }}
pages-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
cache: pip
python-version: '3.11'
- run: env | sort
- run: make dev-docs
- run: make docs
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: public
pages-deploy:
needs: build
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- id: deployment
name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2
name: Release
on:
push:
tags:
- v[1-9][0-9]*.[0-9]+.[0-9]+
- v0.[0-9]+.[0-9]+

0 comments on commit 988f872

Please sign in to comment.