|
7 | 7 | push: |
8 | 8 | branches: |
9 | 9 | - "main" |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +env: |
| 13 | + REGISTRY: ghcr.io |
10 | 14 |
|
11 | 15 | jobs: |
12 | 16 | commitlint: |
13 | | - runs-on: ubuntu-22.04 |
| 17 | + runs-on: ubuntu-24.04 |
14 | 18 | steps: |
15 | 19 | - name: Checkout |
16 | 20 | uses: actions/checkout@v4 |
17 | 21 | with: |
18 | 22 | fetch-depth: 0 |
19 | | - - uses: wagoid/commitlint-github-action@v4 |
| 23 | + - name: Lint |
| 24 | + uses: wagoid/commitlint-github-action@v4 |
20 | 25 | test: |
21 | | - runs-on: ubuntu-22.04 |
| 26 | + runs-on: ubuntu-24.04 |
22 | 27 | steps: |
23 | 28 | - name: Checkout |
24 | 29 | uses: actions/checkout@v4 |
|
36 | 41 | - name: Test |
37 | 42 | run: docker run --rm -t ${{ steps.build.outputs.imageid }} poetry run pytest |
38 | 43 | release: |
39 | | - runs-on: ubuntu-22.04 |
| 44 | + runs-on: ubuntu-24.04 |
40 | 45 | needs: [commitlint, test] |
41 | 46 | if: github.event_name == 'push' |
| 47 | + outputs: |
| 48 | + git-tag: ${{ steps.semantic.outputs.git-tag }} |
42 | 49 | steps: |
43 | 50 | - name: Checkout |
44 | 51 | uses: actions/checkout@v4 |
|
47 | 54 | with: |
48 | 55 | node-version: 20 |
49 | 56 | - 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 |
52 | 60 | env: |
53 | | - GITHUB_USERNAME: ${{ secrets.GH_USERNAME }} |
54 | | - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |
| 61 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
55 | 62 | 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 |
0 commit comments