-
Notifications
You must be signed in to change notification settings - Fork 4
75 lines (61 loc) · 2.83 KB
/
release.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: release
on:
release: # Docs: <https://git.io/JeBz1#release-event-release>
types: [published]
jobs:
docker-image:
name: Build docker image
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- {uses: gacts/github-slug@v1, id: slug}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3 # Action page: <https://github.com/docker/login-action>
with: {username: '${{ secrets.DOCKER_LOGIN }}', password: '${{ secrets.DOCKER_PASSWORD }}'}
- uses: docker/login-action@v3
with: {registry: ghcr.io, username: '${{ github.actor }}', password: '${{ secrets.GITHUB_TOKEN }}'}
- uses: docker/build-push-action@v6 # Action page: <https://github.com/docker/build-push-action>
with:
context: .
file: Dockerfile
push: true
# supported platforms list can be found here: <https://hub.docker.com/_/gcc/tags?page=1&name=12>
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x # <-- important
build-args: VERSION=${{ steps.slug.outputs.version-semantic }}
tags: |
tarampampam/mustpl:latest
tarampampam/mustpl:${{ steps.slug.outputs.version-semantic }}
ghcr.io/${{ github.actor }}/mustpl:latest
ghcr.io/${{ github.actor }}/mustpl:${{ steps.slug.outputs.version-semantic }}
binary-files:
name: Publish the binary file (${{ matrix.platform }})
runs-on: ubuntu-22.04
needs: [docker-image]
strategy:
matrix:
platform: # the list should be the same as the platforms listed above
- linux/386
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64/v8
- linux/ppc64le
- linux/s390x
steps:
- uses: actions/checkout@v4
- {uses: gacts/github-slug@v1, id: slug}
- uses: docker/login-action@v3 # Action page: <https://github.com/docker/login-action>
with: {registry: ghcr.io, username: '${{ github.actor }}', password: '${{ secrets.GITHUB_TOKEN }}'}
- run: |
docker pull --platform "${{ matrix.platform }}" ghcr.io/${{ github.actor }}/mustpl:${{ steps.slug.outputs.version-semantic }}
docker create --name app --platform "${{ matrix.platform }}" ghcr.io/${{ github.actor }}/mustpl:${{ steps.slug.outputs.version-semantic }}
docker cp app:/bin/mustpl ./mustpl
- {uses: gacts/github-slug@v1, id: filename, with: {to-slug: 'mustpl-${{ matrix.platform }}'}}
- name: Upload binary file to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./mustpl
asset_name: ${{ steps.filename.outputs.slug }}
tag: ${{ github.ref }}