Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: trigger release process #26

Merged
merged 48 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
c9cca7c
feat: curation
Jan 31, 2025
5865019
feat: curation validator
SzymonSzyszkowski Feb 3, 2025
2977878
chore: cleanup
SzymonSzyszkowski Feb 3, 2025
7037c0b
test(curation validation): add test cases for expectations
SzymonSzyszkowski Feb 5, 2025
5d7e1f2
chore: delete coverage file
SzymonSzyszkowski Feb 5, 2025
a1c896b
test: curation validation
Feb 5, 2025
071aad3
docs(validate_curation): added example command to readme
Feb 5, 2025
fbf2da1
feat: pyftpdlib
Feb 4, 2025
a9aef25
test: mock ebi ftp server
Feb 6, 2025
4d762d1
chore: linting
Feb 6, 2025
cb60d0b
chore(dependency management): replace rye with uv
Feb 10, 2025
8340162
feat: workflow on pr
Feb 11, 2025
32de031
0.2.0
invalid-email-address Dec 6, 2024
9096a4e
feat(dev_process): changes to development process
Feb 11, 2025
5f571e1
1.0.0-rc.1
Feb 11, 2025
67eb06b
feat: reusable workflow for release
Feb 11, 2025
39315b5
1.0.0-rc.2
Feb 11, 2025
d93d8a3
chore: add name to tag action
Feb 11, 2025
ec2f701
fix: incorrect python version in gha
Feb 11, 2025
548e6f6
1.0.0-rc.3
Feb 11, 2025
daca0aa
feat: preparation for dev release
Feb 11, 2025
cfb39e2
feat: add release badge
SzymonSzyszkowski Feb 11, 2025
bfebc48
1.0.0-rc.4
Feb 11, 2025
3e73526
feat: allow trusted publisher in pypi actions
SzymonSzyszkowski Feb 11, 2025
67c4035
1.0.0-rc.5
Feb 11, 2025
3179d8c
feat: allow trusted publisher in pypi actions
SzymonSzyszkowski Feb 11, 2025
6849fb2
1.0.0-rc.6
Feb 11, 2025
48d3ca4
feat: allow trusted publisher in pypi actions
SzymonSzyszkowski Feb 11, 2025
c92b61c
1.0.0-rc.7
Feb 11, 2025
0f4bfd4
feat: change to test env for test pypi release
SzymonSzyszkowski Feb 11, 2025
e8514f9
1.0.0-rc.8
Feb 11, 2025
5401de5
feat: dev environment deployment trigger
Feb 12, 2025
cbc3c1d
1.0.0-rc.9
Feb 12, 2025
ff382dc
feat: drop workflow name
Feb 12, 2025
ff09400
1.0.0-rc.10
Feb 12, 2025
6972951
feat: revert name removal
Feb 12, 2025
6db5e41
1.0.0-rc.11
Feb 12, 2025
1ff5138
feat: change release token to dev
Feb 12, 2025
7271295
1.0.0-dev.1
Feb 12, 2025
873130a
feat: ensure the url is present in the env
Feb 12, 2025
b5bb374
1.0.0-dev.2
Feb 12, 2025
2b29a5d
Merge branch 'main' into dev
Feb 12, 2025
eec0a0e
1.0.0-dev.3
Feb 12, 2025
f98fdf8
feat: remove development release
Feb 12, 2025
5d7c85e
1.0.0-dev.4
Feb 12, 2025
c3c2979
feat: update uv lock
Feb 12, 2025
fdcbafb
1.0.0-dev.5
Feb 12, 2025
61e962a
chore: update readme
Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: template-release

on:
workflow_call:
inputs:
environment:
type: string
description: release environment
required: true
url:
type: string
description: release url
required: true

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
- uses: astral-sh/setup-uv@v5
- name: Install project
run: uv sync --all-extras
- name: Build package
run: make build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

release:
needs: build
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
environment:
name: ${{ inputs.environment }}
url: ${{ inputs.url }}
steps:
- uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to ${{ vars.PYPI_NAME }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: ${{ vars.PYPI_URL }}
packages-dir: dist/
45 changes: 0 additions & 45 deletions .github/workflows/_tag.yaml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: label-pr

"on":
- pull_request
- issues

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: srvaroa/labeler@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
50 changes: 32 additions & 18 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
name: Dev tests
name: checks

on:
pull_request:
branches:
- dev
- main


env:
PYTHON_VERSION_DEFAULT: "3.10.8"
jobs:
test:
check:
name: ${{ matrix.command }}-${{ matrix.python-version }}
strategy:
max-parallel: 2
matrix:
python-version: ["3.10", "3.11", "3.12"]
command: ["test", "type-check", "dep-check", "lint"]
# Skip redundant checks.
exclude:
- command: "lint"
python-version: "3.11"
- command: "lint"
python-version: "3.12"
- command: "dep-check"
python-version: "3.11"
- command: "dep-check"
python-version: "3.12"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10.8
- name: Install uv
uses: yezz123/setup-uv@v4
- name: Install rye
uses: eifinger/setup-rye@v4
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Sync dependencies
run: rye sync
- name: Run checks
run: rye run pre-commit run --all-files
enable-cache: true
cache-dependency-glob: "uv.lock"
python-version: ${{ matrix.python-version }}
- name: Install project
run: uv sync --all-extras
- name: Run test
run: make ${{ matrix.command }}
85 changes: 19 additions & 66 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,72 +1,25 @@
name: Release

name: release
on:
push:
tags:
- "v*"
tags: ['v[0-9]+.[0-9]+.[0-9]']
workflow_dispatch:

env:
PYTHON_VERSION_DEFAULT: "3.10.8"
concurrency:
group: prod
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10.8
- name: Install uv
uses: yezz123/setup-uv@v4
- name: Install rye
uses: eifinger/setup-rye@v4
with:
version: "latest"
- name: Sync dependencies
run: rye sync
- name: Build package
run: make build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

test-release:
needs: build
runs-on: ubuntu-latest
environment: TEST
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: dist/

release:
needs: test-release
runs-on: ubuntu-latest
environment: PyPI
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://upload.pypi.org/legacy/
packages-dir: dist/
name: test-pypi-release
uses: ./.github/workflows/_release.yaml
with:
environment: DEV
url: https://test.pypi.org/p/gentroutils

dev-release:
needs: release
name: pypi-release
uses: ./.github/workflows/_release.yaml
with:
environment: PyPI
url: https://pypi.org/p/gentroutils
8 changes: 4 additions & 4 deletions .github/workflows/release_pr.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Trigger Release
name: trigger-release

"on":
on:
schedule:
- cron: "0 11 * * 2"
workflow_dispatch:

jobs:
pull-request:
prepare-release-pr:
runs-on: ubuntu-latest
environment: DEV
steps:
- uses: actions/create-github-app-token@v1
id: trigger-token
with:
app-id: ${{ vars.TRIGGER_WORKFLOW_GH_APP_ID}}
app-id: ${{ vars.TRIGGER_WORKFLOW_GH_APP_ID }}
private-key: ${{ secrets.TRIGGER_WORKFLOW_GH_APP_KEY }}
- uses: actions/checkout@v4
with:
Expand Down
53 changes: 41 additions & 12 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,45 @@
name: Tag

"on":
name: tag-release
on:
push:
# main branch - release, dev branch - dev release
branches: ["main", "dev"]

concurrency:
group: deploy
cancel-in-progress: false

env:
PYTHON_VERSION_DEFAULT: "3.10.8"
branches:
- dev
- main


jobs:
create-tag:
# NOTE: only trigger the workflow when the commit is not from the GitHubActions bot (prevent self-triggering)
if: github.event.commits[0].author.name != 'github-actions'
runs-on: ubuntu-latest
concurrency: release
environment: DEV
permissions:
contents: write

steps:
# NOTE: commits using GITHUB_TOKEN does not trigger workflows and we want to trigger PiPY from tag
- uses: actions/create-github-app-token@v1
id: trigger-token
with:
app-id: ${{ vars.TRIGGER_WORKFLOW_GH_APP_ID}}
private-key: ${{ secrets.TRIGGER_WORKFLOW_GH_APP_KEY }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: opentargets/gentroutils
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: false
ref: ${{ github.ref_name }}
- name: Create package release
id: semrelease
# v9.6.0 is required due to the python v3.12 in the newer version of semantic release action which
# breaks the poetry build command.
uses: python-semantic-release/python-semantic-release@v9.19.1
with:
github_token: ${{ steps.trigger-token.outputs.token }}
- name: Publish package to GitHub Release
uses: python-semantic-release/publish-action@v9.19.1
if: ${{ steps.semrelease.outputs.released }} == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.semrelease.outputs.tag }}
31 changes: 0 additions & 31 deletions .github/workflows/test.yaml

This file was deleted.

1 change: 0 additions & 1 deletion .python-version

This file was deleted.

Loading
Loading