-
Notifications
You must be signed in to change notification settings - Fork 6
87 lines (87 loc) · 3.06 KB
/
publish.yml
File metadata and controls
87 lines (87 loc) · 3.06 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: docker publish
on:
push:
tags:
- '*'
jobs:
build-amd64:
runs-on: ubuntu-latest
timeout-minutes: 360
steps:
- name: checkout code
uses: actions/checkout@v4
- name: setup qemu
uses: docker/setup-qemu-action@v3
- name: setup buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: print available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: set version from tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: print version number
run: echo ${{ env.RELEASE_VERSION }}
- name: login to dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_UPLOAD_USERNAME }}
password: ${{ secrets.DOCKER_UPLOAD_TOKEN }}
- name: build & upload
run: |
docker buildx build \
--push \
--tag plattar/python-usd:version-${{ env.RELEASE_VERSION }}-amd64 \
--platform linux/amd64 \
--file Dockerfile .
build-arm64:
runs-on: macos-14
timeout-minutes: 360
steps:
- name: checkout code
uses: actions/checkout@v4
- name: setup docker on macOS
uses: docker-practice/actions-setup-docker@master
timeout-minutes: 12
- name: setup qemu
uses: docker/setup-qemu-action@v3
- name: setup buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: print available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: set version from tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: print version number
run: echo ${{ env.RELEASE_VERSION }}
- name: login to dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_UPLOAD_USERNAME }}
password: ${{ secrets.DOCKER_UPLOAD_TOKEN }}
- name: build & upload
run: |
docker buildx build \
--push \
--tag plattar/python-usd:version-${{ env.RELEASE_VERSION }}-arm64 \
--platform linux/arm64 \
--file Dockerfile .
build-manifest:
runs-on: ubuntu-latest
timeout-minutes: 360
needs: [build-amd64, build-arm64]
steps:
- name: checkout code
uses: actions/checkout@v4
- name: set version from tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: print version number
run: echo ${{ env.RELEASE_VERSION }}
- name: login to dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_UPLOAD_USERNAME }}
password: ${{ secrets.DOCKER_UPLOAD_TOKEN }}
- name: create manifest
run: docker manifest create plattar/python-usd:version-${{ env.RELEASE_VERSION }} plattar/python-usd:version-${{ env.RELEASE_VERSION }}-amd64 plattar/python-usd:version-${{ env.RELEASE_VERSION }}-arm64
- name: upload manifest
run: docker manifest push plattar/python-usd:version-${{ env.RELEASE_VERSION }}