-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (53 loc) · 1.85 KB
/
publish-main.yml
File metadata and controls
61 lines (53 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: 🚀 publish
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
test_and_publish:
uses: ./.github/workflows/publish.yml
with:
# so easy to forget bumping the version to match the tag, just override it!
version: ${{ github.ref_name }}
secrets:
twine_token: ${{ secrets.PYPI_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build_image:
# TODO: remove this entire job if an image does not make sense (ie: just a library, no CLI)
permissions: write-all
needs: test_and_publish
name: release image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Build and push image - release
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/amd64,linux/arm64
cache-from: ghcr.io/${{ github.repository }}:latest-build-cache
cache-to: ghcr.io/${{ github.repository }}:latest-build-cache
tags: |
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
ghcr.io/${{ github.repository }}:latest
- name: Show summary
run: |
echo 'Published: ' >> ${GITHUB_STEP_SUMMARY}
echo '* `ghcr.io/${{ github.repository }}:${{ github.ref_name }}`' >> ${GITHUB_STEP_SUMMARY}
echo '* `ghcr.io/${{ github.repository }}:latest`' >> ${GITHUB_STEP_SUMMARY}