Skip to content

Commit 7915f0c

Browse files
committed
workflows refactoring
1 parent 03a23f1 commit 7915f0c

File tree

7 files changed

+110
-157
lines changed

7 files changed

+110
-157
lines changed

.github/workflows/cd.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: "Continuous Deployment"
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
10+
#############################################################################
11+
# Create and online deployment of the documentation #########################
12+
docs: #######################################################################
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Install Dependencies (pip)
18+
shell: bash
19+
run: |
20+
python -m pip install --upgrade pip
21+
python -m pip install .[docs]
22+
23+
- name: Build Documentation
24+
run: |
25+
make html
26+
working-directory: docs/
27+
28+
- name: Deploy
29+
uses: peaceiris/actions-gh-pages@v3
30+
with:
31+
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
publish_dir: ./docs/build/html
33+
allow_empty_commit: true
34+
35+
#############################################################################
36+
## Publish the distribution to PyPI #########################################
37+
distribution_pypi: ##########################################################
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Install build
43+
run: >-
44+
python -m pip install build --user
45+
46+
- name: Build a binary wheel and a source tarball
47+
run: >-
48+
python -m build --sdist --wheel --outdir dist/ .
49+
50+
- name: Publish distribution to PyPI
51+
if: startsWith(github.ref, 'refs/tags')
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
with:
54+
password: ${{ secrets.PYPI_API_TOKEN }}
55+
56+
#############################################################################
57+
## Create a public "Release" on the Github page #############################
58+
release_github: #############################################################
59+
runs-on: ubuntu-latest
60+
permissions:
61+
contents: write
62+
steps:
63+
- uses: actions/checkout@v4
64+
- uses: ncipollo/release-action@v1
65+
with:
66+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

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

.github/workflows/create-release.yml

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

.github/workflows/create-tag.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Create Git Tag
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag_name:
7+
description: "Tag name (eg. v1.3.0)"
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
create_tag:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
persist-credentials: false
24+
25+
- name: Configure git with PAT
26+
run: |
27+
git config user.name "github-actions[bot]"
28+
git config user.email "github-actions[bot]@users.noreply.github.com"
29+
git remote set-url origin "https://x-access-token:${{ secrets.PAT_EZYRB_PUSH }}@github.com/${{ github.repository }}.git"
30+
31+
- name: Check if the tag is already existing
32+
run: |
33+
TAG="${{ inputs.tag_name }}"
34+
git fetch --tags
35+
if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then
36+
echo "❌ Tag $TAG already exists"
37+
exit 1
38+
fi
39+
40+
- name: Create and push the tag
41+
run: |
42+
TAG="${{ inputs.tag_name }}"
43+
git tag "$TAG"
44+
git push origin "$TAG"

.github/workflows/monthly-tag.yml

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

.github/workflows/pypi-publish.yml

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

.github/workflows/sphinx-build.yml

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

0 commit comments

Comments
 (0)