Skip to content

Commit 165f22d

Browse files
Merge pull request #75 from luisiturrios1/ci/semantic-release-workflows
ci: automate semantic release workflows
2 parents f216f63 + 3331e22 commit 165f22d

20 files changed

Lines changed: 600 additions & 1012 deletions

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v3
41+
uses: actions/checkout@v6
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v2
45+
uses: github/codeql-action/init@v4
4646
with:
4747
languages: ${{ matrix.language }}
4848
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +53,7 @@ jobs:
5353
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5454
# If this step fails, then you should remove it and run the build manually (see below)
5555
# - name: Autobuild
56-
# uses: github/codeql-action/autobuild@v2
56+
# uses: github/codeql-action/autobuild@v4
5757

5858
# ℹ️ Command-line programs to run using the OS shell.
5959
# 📚 https://git.io/JvXDl
@@ -67,4 +67,4 @@ jobs:
6767
# make release
6868

6969
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v2
70+
uses: github/codeql-action/analyze@v4

.github/workflows/continuous_deployment.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/continuous_integration.yml

Lines changed: 0 additions & 81 deletions
This file was deleted.

.github/workflows/dependency-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: 'Checkout Repository'
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v6
1919
- name: 'Dependency Review'
20-
uses: actions/dependency-review-action@v1
20+
uses: actions/dependency-review-action@v5

.github/workflows/greetings.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/prerelease.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Prerelease
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
types:
8+
- opened
9+
- synchronize
10+
- reopened
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
test:
17+
name: ${{ matrix.runner }} / Python ${{ matrix.python-version }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
python-version: ["3.11", "3.12", "3.13", "3.14"]
22+
runner: [macos-latest, ubuntu-latest, windows-latest]
23+
architecture: [x64]
24+
uses: ./.github/workflows/test.yml
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
runner: ${{ matrix.runner }}
28+
architecture: ${{ matrix.architecture }}
29+
build-distribution: ${{ matrix.runner == 'ubuntu-latest' && matrix.python-version == '3.13' }}
30+
31+
prerelease:
32+
name: Prerelease to PyPI
33+
if: github.event.pull_request.head.repo.full_name == github.repository
34+
needs: test
35+
runs-on: ubuntu-latest
36+
environment: pypi-prerelease
37+
concurrency:
38+
group: ${{ github.workflow }}-pr-${{ github.event.pull_request.number }}
39+
cancel-in-progress: false
40+
permissions:
41+
contents: write
42+
id-token: write
43+
pull-requests: read
44+
env:
45+
CI: "1"
46+
47+
steps:
48+
- name: Checkout pull request branch
49+
uses: actions/checkout@v6
50+
with:
51+
repository: ${{ github.event.pull_request.head.repo.full_name }}
52+
ref: ${{ github.event.pull_request.head.ref }}
53+
fetch-depth: 0
54+
fetch-tags: true
55+
token: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- name: Create prerelease tag and distributions
58+
id: prerelease
59+
uses: python-semantic-release/python-semantic-release@v10.5.3
60+
with:
61+
github_token: ${{ secrets.GITHUB_TOKEN }}
62+
prerelease: "true"
63+
prerelease_token: "dev"
64+
commit: "false"
65+
tag: "true"
66+
push: "true"
67+
vcs_release: "false"
68+
changelog: "false"
69+
70+
- name: Publish prerelease distributions to PyPI
71+
if: steps.prerelease.outputs.released == 'true'
72+
uses: pypa/gh-action-pypi-publish@release/v1
73+
with:
74+
packages-dir: dist/
75+
print-hash: true

.github/workflows/release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
release:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
environment: pypi-release
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref_name }}
18+
cancel-in-progress: false
19+
permissions:
20+
contents: write
21+
id-token: write
22+
env:
23+
CI: "1"
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v6
28+
with:
29+
fetch-depth: 0
30+
fetch-tags: true
31+
32+
- name: Set up Python 3.13
33+
uses: actions/setup-python@v6
34+
with:
35+
python-version: "3.13"
36+
cache: pip
37+
cache-dependency-path: pyproject.toml
38+
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
43+
- name: Create version, tag, release and distributions
44+
id: release
45+
uses: python-semantic-release/python-semantic-release@v10.5.3
46+
with:
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
git_committer_name: github-actions[bot]
49+
git_committer_email: 41898282+github-actions[bot]@users.noreply.github.com
50+
changelog: "false"
51+
52+
- name: Publish package distributions to PyPI
53+
if: steps.release.outputs.released == 'true'
54+
uses: pypa/gh-action-pypi-publish@release/v1
55+
with:
56+
packages-dir: dist/
57+
print-hash: true
58+
59+
- name: Upload distributions to GitHub Release
60+
if: steps.release.outputs.released == 'true'
61+
uses: python-semantic-release/publish-action@v10.5.3
62+
with:
63+
github_token: ${{ secrets.GITHUB_TOKEN }}
64+
tag: ${{ steps.release.outputs.tag }}

.github/workflows/stale.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)