-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from opentargets/new-branch
ci: ci test release
- Loading branch information
Showing
7 changed files
with
215 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
env: | ||
PYTHON_VERSION_DEFAULT: "3.10.8" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
environment: PyPI | ||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
contents: write | ||
steps: | ||
- 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: 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: Publish distribution 📦 to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/gentroutils/ | ||
packages-dir: dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: PR to trigger release | ||
|
||
"on": | ||
schedule: | ||
- cron: "15 16 * * 4" | ||
|
||
jobs: | ||
pull-request: | ||
runs-on: ubuntu-latest | ||
environment: PyPI | ||
steps: | ||
- 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/gentropy | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
persist-credentials: false | ||
- uses: actions/checkout@v3 | ||
- name: pull-request | ||
uses: diillson/auto-pull-request@v1.0.1 | ||
with: | ||
source_branch: "dev" | ||
destination_branch: "main" | ||
pr_title: "chore: trigger release process" | ||
pr_body: ":warning: *This PR requires a MERGE COMMIT (Don't squash or rebase!)*" | ||
pr_label: "auto-pr" | ||
pr_draft: false | ||
pr_allow_empty: true | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Release | ||
|
||
"on": | ||
push: | ||
branches: ["main"] | ||
|
||
concurrency: | ||
group: deploy | ||
cancel-in-progress: false # prevent hickups with semantic-release | ||
|
||
env: | ||
PYTHON_VERSION_DEFAULT: "3.10.8" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
concurrency: release | ||
environment: PyPI | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
# NOTE: commits using GITHUB_TOKEN does not trigger workflows | ||
- 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/gentropy | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
persist-credentials: false | ||
|
||
- name: Python Semantic 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.6.0 | ||
with: | ||
github_token: ${{ steps.trigger-token.outputs.token }} | ||
|
||
- name: Publish package to GitHub Release | ||
uses: python-semantic-release/upload-to-gh-release@main | ||
if: ${{ steps.semrelease.outputs.released }} == 'true' | ||
with: | ||
# NOTE: allow to start the workflow when push action on tag gets executed | ||
# requires using GH_APP to authenitcate, otherwise push authorised with | ||
# the GITHUB_TOKEN does not trigger the tag artifact workflow. | ||
# see https://github.com/actions/create-github-app-token | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ steps.semrelease.outputs.tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters