-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (86 loc) · 3.24 KB
/
continuous-delivery.yml
File metadata and controls
92 lines (86 loc) · 3.24 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
88
89
90
91
92
name: Continuous Delivery (CD)
on:
release:
types: [published]
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
contents: write
packages: write
jobs:
publish-binary:
name: Publish Binary
runs-on: ${{ matrix.architecture }}
strategy:
matrix:
architecture: [ubuntu-24.04, ubuntu-24.04-arm]
steps:
- name: Checkout code.
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Nix.
uses: cachix/install-nix-action@2126ae7fc54c9df00dd18f7f18754393182c73cd # v31.9.1
- name: Publish binary.
run: nix develop -c make publish-binary RELEASE="${GITHUB_REF_NAME}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by GitHub Actions.
<<<<<<< before updating
=======
publish-crate:
name: Publish Crate
runs-on: ubuntu-24.04
steps:
- name: Checkout code.
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Nix.
uses: cachix/install-nix-action@2126ae7fc54c9df00dd18f7f18754393182c73cd # v31.9.1
- name: Publish crate.
run: nix develop -c make publish-crate
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
>>>>>>> after updating
publish-docker-image:
name: Publish Docker Image (${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
needs: [publish-binary]
strategy:
matrix:
include:
- platform: linux/amd64
runner: ubuntu-24.04
target: x86_64-unknown-linux-musl
suffix: amd64
- platform: linux/arm64
runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
suffix: arm64
steps:
- name: Checkout code.
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Login to GitHub Container Registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Docker Image
run: make publish-docker-image RELEASE="${GITHUB_REF_NAME}" PLATFORM="${{ matrix.platform }}" TARGET="${{ matrix.target }}" SUFFIX="${{ matrix.suffix }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-docker-manifest:
name: Publish Docker Manifest
runs-on: ubuntu-24.04
needs: [publish-docker-image]
steps:
- name: Checkout code.
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Login to GitHub Container Registry
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Docker Manifest
run: make publish-docker-manifest RELEASE="${GITHUB_REF_NAME}"