-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (73 loc) · 3.34 KB
/
publish.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
76
77
78
79
80
81
82
83
84
85
86
name: Tag & Release
on:
workflow_dispatch:
jobs:
release:
strategy:
matrix:
job:
- runner: buildjet-4vcpu-ubuntu-2204
arch: amd64
- runner: buildjet-4vcpu-ubuntu-2204-arm
arch: arm64
name: Release - ${{ matrix.job.arch }}
runs-on: ${{ matrix.job.runner }}
outputs:
published: ${{ steps.release.outputs.published }}
version: ${{ steps.release.outputs.version }}
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: v0.10.2
- name: Docker Login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.API_TOKEN_GITHUB }}
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
- name: Install npm dependencies
run: yarn install --frozen-lockfile
- name: Release
id: release
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
GITHUB_USER: ${{ github.actor }}
run: yarn run semantic-release --extends ./release.config.${{ matrix.job.arch }}.js --tag-format='${version}-${{ matrix.job.arch }}'
create-manifest:
name: Create Multi-Arch Manifest
runs-on: buildjet-2vcpu-ubuntu-2204
needs: release
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.API_TOKEN_GITHUB }}
- name: Create Manifest
shell: bash
if: needs.release.outputs.published == 'true'
run: |
echo Published ${{ needs.release.outputs.published }}
echo Version ${{ needs.release.outputs.version }}
docker manifest create ghcr.io/greenroom-robotics/ros_builder:jazzy-latest \
ghcr.io/greenroom-robotics/ros_builder:jazzy-latest-amd64 \
ghcr.io/greenroom-robotics/ros_builder:jazzy-latest-arm64
docker manifest create ghcr.io/greenroom-robotics/ros_builder:jazzy-latest-cuda \
ghcr.io/greenroom-robotics/ros_builder:jazzy-latest-cuda-amd64 \
ghcr.io/greenroom-robotics/ros_builder:jazzy-latest-cuda-arm64
docker manifest create ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }} \
ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}-amd64 \
ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}-arm64
docker manifest create ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}-cuda \
ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}-cuda-amd64 \
ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}-cuda-arm64
docker manifest push ghcr.io/greenroom-robotics/ros_builder:jazzy-latest
docker manifest push ghcr.io/greenroom-robotics/ros_builder:jazzy-latest-cuda
docker manifest push ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}
docker manifest push ghcr.io/greenroom-robotics/ros_builder:jazzy-${{ needs.release.outputs.version }}-cuda