Skip to content

Commit 3453f2f

Browse files
authored
ci: update ci implementation and pyproject.toml
1 parent 13002d0 commit 3453f2f

File tree

5 files changed

+136
-77
lines changed

5 files changed

+136
-77
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,23 @@ on:
77
push:
88
branches:
99
- "main"
10+
workflow_dispatch:
11+
12+
env:
13+
REGISTRY: ghcr.io
1014

1115
jobs:
1216
commitlint:
13-
runs-on: ubuntu-22.04
17+
runs-on: ubuntu-24.04
1418
steps:
1519
- name: Checkout
1620
uses: actions/checkout@v4
1721
with:
1822
fetch-depth: 0
19-
- uses: wagoid/commitlint-github-action@v4
23+
- name: Lint
24+
uses: wagoid/commitlint-github-action@v4
2025
test:
21-
runs-on: ubuntu-22.04
26+
runs-on: ubuntu-24.04
2227
steps:
2328
- name: Checkout
2429
uses: actions/checkout@v4
@@ -36,9 +41,11 @@ jobs:
3641
- name: Test
3742
run: docker run --rm -t ${{ steps.build.outputs.imageid }} poetry run pytest
3843
release:
39-
runs-on: ubuntu-22.04
44+
runs-on: ubuntu-24.04
4045
needs: [commitlint, test]
4146
if: github.event_name == 'push'
47+
outputs:
48+
git-tag: ${{ steps.semantic.outputs.git-tag }}
4249
steps:
4350
- name: Checkout
4451
uses: actions/checkout@v4
@@ -47,9 +54,46 @@ jobs:
4754
with:
4855
node-version: 20
4956
- name: Install semantic-release
50-
run: npm i semantic-release@v23.0.0 conventional-changelog-conventionalcommits@7.0.2
51-
- name: Release
57+
run: npm i semantic-release@v24.2.5 @semantic-release/exec@v7.1.0 conventional-changelog-conventionalcommits@9.0.0
58+
- name: Run semantic-release
59+
id: semantic
5260
env:
53-
GITHUB_USERNAME: ${{ secrets.GH_USERNAME }}
54-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5562
run: npx semantic-release
63+
ghcr:
64+
runs-on: ubuntu-24.04
65+
if: |
66+
github.repository_owner == 'Virtool' &&
67+
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
68+
needs.release.outputs.git-tag
69+
needs: [release]
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v4
73+
with:
74+
ref: ${{ needs.release.outputs.git-tag }}
75+
- name: Install Poetry
76+
uses: snok/install-poetry@v1
77+
- name: Write VERSION file
78+
run: echo ${{ needs.release.outputs.git-tag }} > VERSION
79+
- name: Update Version
80+
run: poetry version ${{ needs.release.outputs.git-tag }}
81+
- name: Login
82+
uses: docker/login-action@v3
83+
with:
84+
registry: ${{ env.REGISTRY }}
85+
username: ${{ github.actor }}
86+
password: ${{ secrets.GITHUB_TOKEN }}
87+
- name: Extract Metadata
88+
id: meta
89+
uses: docker/metadata-action@v5
90+
with:
91+
images: ${{ env.REGISTRY }}/virtool/build-index
92+
- name: Build and Push
93+
uses: docker/build-push-action@v5
94+
with:
95+
context: .
96+
labels: ${{ steps.meta.outputs.labels }}
97+
push: true
98+
tags: ${{ steps.meta.outputs.tags }}
99+
target: base

.github/workflows/publish.yml

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

.releaserc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@
1818
"@semantic-release/release-notes-generator", {
1919
"preset": "conventionalcommits"
2020
},
21-
["@semantic-release/github", {
22-
"failComment": false
23-
}]
21+
"@semantic-release/github",
22+
[
23+
"@semantic-release/exec",
24+
{
25+
"successCmd":"echo \"git-tag=${nextRelease.gitTag}\" >> $GITHUB_OUTPUT"
26+
}
27+
]
2428
],
2529
"repositoryUrl": "https://github.com/virtool/workflow-build-index.git",
2630
"tagFormat": "${version}"

0 commit comments

Comments
 (0)