Skip to content

Commit 4e9d447

Browse files
authored
fix: prevent job archived error
* Fix CI issues. * Use `virtool-workflow==7.1.4`. * Support CI on `workflow_dispatch`.
1 parent 38a769d commit 4e9d447

File tree

8 files changed

+2238
-591
lines changed

8 files changed

+2238
-591
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@ on:
88
branches:
99
- "main"
1010

11+
workflow_dispatch:
12+
13+
env:
14+
REGISTRY: ghcr.io
15+
1116
jobs:
1217
commitlint:
13-
runs-on: ubuntu-22.04
18+
runs-on: ubuntu-24.04
1419
steps:
1520
- name: Checkout
1621
uses: actions/checkout@v4
@@ -19,34 +24,68 @@ jobs:
1924
- name: commitlint
2025
uses: wagoid/commitlint-github-action@v5
2126
test:
22-
runs-on: ubuntu-22.04
27+
runs-on: ubuntu-24.04
2328
env:
2429
USER_ID: 1001
2530
GROUP_ID: 1001
2631
steps:
2732
- name: Checkout
2833
uses: actions/checkout@v4
2934
- name: Compose Build
30-
run: docker-compose build --progress=plain
35+
run: docker compose build --progress=plain
3136
- name: Compose Up
32-
run: docker-compose up -d
37+
run: docker compose up -d
3338
- name: Test
3439
run: docker compose exec app poetry run pytest
3540
release:
36-
runs-on: ubuntu-22.04
37-
needs: [test, commitlint]
41+
runs-on: ubuntu-24.04
3842
if: github.event_name == 'push'
43+
needs: [test, commitlint]
44+
outputs:
45+
git-tag: ${{ steps.semantic.outputs.git-tag }}
3946
steps:
4047
- name: Checkout
4148
uses: actions/checkout@v4
4249
- name: Setup Node.js
4350
uses: actions/setup-node@v4
44-
with:
45-
node-version: 20
4651
- name: Install semantic-release
47-
48-
- name: Release
52+
53+
- name: Run semantic-release
54+
id: semantic
4955
env:
50-
GITHUB_USERNAME: ${{ secrets.GH_USERNAME }}
51-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5257
run: npx semantic-release
58+
ghcr:
59+
runs-on: ubuntu-24.04
60+
if: |
61+
github.repository_owner == 'Virtool' &&
62+
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
63+
needs.release.outputs.git-tag != ''
64+
needs: [release]
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v4
68+
with:
69+
ref: ${{ needs.release.outputs.git-tag }}
70+
- name: Write VERSION file
71+
run: echo ${{ needs.release.outputs.git-tag }} > VERSION
72+
- name: Login to Registry
73+
uses: docker/login-action@v3
74+
with:
75+
registry: ${{ env.REGISTRY }}
76+
username: ${{ github.actor }}
77+
password: ${{ secrets.GITHUB_TOKEN }}
78+
- name: Extract Metadata
79+
id: meta
80+
uses: docker/metadata-action@v5
81+
with:
82+
context: git
83+
images: ${{ env.REGISTRY }}/virtool/nuvs
84+
- name: Build and Push
85+
uses: docker/build-push-action@v4
86+
with:
87+
context: .
88+
labels: ${{ steps.meta.outputs.labels }}
89+
push: true
90+
tags: ${{ steps.meta.outputs.tags }}
91+
target: base

.github/workflows/publish.yml

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

.releaserc

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
{
2-
"branches": [
3-
"main",
2+
"branches":[
3+
"main"
44
],
5-
"plugins": [
6-
["@semantic-release/commit-analyzer", {
7-
"preset": "conventionalcommits"
8-
}],
9-
"@semantic-release/release-notes-generator", {
10-
"preset": "conventionalcommits"
5+
"plugins":[
6+
[
7+
"@semantic-release/commit-analyzer",
8+
{
9+
"preset":"conventionalcommits"
10+
}
11+
],
12+
"@semantic-release/release-notes-generator",
13+
{
14+
"preset":"conventionalcommits"
1115
},
12-
["@semantic-release/github", {
13-
"failComment": false
14-
}]
16+
"@semantic-release/github",
17+
[
18+
"@semantic-release/exec",
19+
{
20+
"successCmd":"echo \"git-tag=${nextRelease.gitTag}\" >> $GITHUB_OUTPUT"
21+
}
22+
]
1523
],
16-
"repositoryUrl": "https://github.com/virtool/workflow-nuvs.git",
17-
"tagFormat": "${version}"
24+
"repositoryUrl":"https://github.com/virtool/workflow-nuvs.git",
25+
"tagFormat":"${version}"
1826
}

0 commit comments

Comments
 (0)