-
Notifications
You must be signed in to change notification settings - Fork 1
147 lines (138 loc) · 4.99 KB
/
stable.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Stable CI
on:
schedule:
- cron: "7 */12 * * *"
env:
NAME: rust
REGISTRY_AUTH_FILE: ./auth.json
SKOPEO_LATEST: true
VERSION: 1.83.0
jobs:
copy:
strategy:
fail-fast: false
matrix:
registry: ["ghcr.io", "docker.io", "quay.io"]
os:
- alpine3.20
- alpine3.19
- bookworm
- slim-bookworm
- bullseye
- slim-bullseye
include:
- os: alpine3.20
tags: |
<full-ver>-alpine3.20
<full-ver>-alpine
<minor-ver>-alpine3.20
<minor-ver>-alpine
<major-ver>-alpine3.20
<major-ver>-alpine
alpine3.20
alpine
- os: alpine3.19
tags: |
<full-ver>-alpine3.19
<minor-ver>-alpine3.19
<major-ver>-alpine3.19
alpine3.19
- os: bookworm
tags: |
<full-ver>-bookworm
<full-ver>
<minor-ver>-bookworm
<minor-ver>
<major-ver>-bookworm
<major-ver>
bookworm
latest
- os: slim-bookworm
tags: |
<full-ver>-slim-bookworm
<full-ver>-slim
<minor-ver>-slim-bookworm
<minor-ver>-slim
<major-ver>-slim-bookworm
<major-ver>-slim
slim-bookworm
slim
- os: bullseye
tags: |
<full-ver>-bullseye
<minor-ver>-bullseye
<major-ver>-bullseye
bullseye
- os: slim-bullseye
tags: |
<full-ver>-slim-bullseye
<minor-ver>-slim-bullseye
<major-ver>-slim-bullseye
slim-bullseye
runs-on: ubuntu-latest
steps:
# Skip if this is fork and no credentials are provided.
- id: skip
run: echo "no=${{ !(
github.repository_owner != 'instrumentisto'
&& ((matrix.registry == 'quay.io'
&& secrets.QUAYIO_ROBOT_USER == '')
|| (matrix.registry == 'docker.io'
&& secrets.DOCKERHUB_BOT_USER == ''))
) }}" >> $GITHUB_OUTPUT
- name: Install latest version of `skopeo`
run: |
sudo apt remove skopeo
sudo apt update
sudo apt install \
go-md2man pkg-config \
libassuan-dev libbtrfs-dev libdevmapper-dev libgpgme-dev
git clone https://github.com/containers/skopeo \
$GOPATH/src/github.com/containers/skopeo
cd $GOPATH/src/github.com/containers/skopeo/
make bin/skopeo
sudo make install
env:
DISABLE_DOCS: 1
GOPATH: /home/runner/go
if: ${{ steps.skip.outputs.no == 'true'
&& env.SKOPEO_LATEST == 'true' }}
- uses: actions/checkout@v4
if: ${{ steps.skip.outputs.no == 'true' }}
- name: Check upstream manifests changed
id: upstream
run: |
result=$(bash stable/check-changed.sh 2>&1)
echo "$result"
echo 'result<<EOF'$'\n'"$result"$'\n'EOF >> $GITHUB_OUTPUT
env:
IMAGE: ${{ matrix.registry }}/${{ github.repository_owner }}/${{ env.NAME }}
SOURCE_TAG: ${{ env.VERSION }}-${{ matrix.os }}
if: ${{ steps.skip.outputs.no == 'true' }}
- name: Login to ${{ matrix.registry }} container registry
run: skopeo login --username='${{ (matrix.registry == 'docker.io'
&& secrets.DOCKERHUB_BOT_USER)
|| (matrix.registry == 'quay.io'
&& secrets.QUAYIO_ROBOT_USER)
|| github.repository_owner }}'
--password='${{ (matrix.registry == 'docker.io'
&& secrets.DOCKERHUB_BOT_PASS)
|| (matrix.registry == 'quay.io'
&& secrets.QUAYIO_ROBOT_TOKEN)
|| secrets.GITHUB_TOKEN }}'
${{ matrix.registry }}
if: ${{ steps.skip.outputs.no == 'true'
&& contains(steps.upstream.outputs.result, 'CHANGED') }}
- name: Copy image
run: bash stable/copy.sh
env:
IMAGE: ${{ matrix.registry }}/${{ github.repository_owner }}/${{ env.NAME }}
SOURCE_TAG: ${{ env.VERSION }}-${{ matrix.os }}
IMAGE_TAGS: ${{ matrix.tags }}
if: ${{ steps.skip.outputs.no == 'true'
&& contains(steps.upstream.outputs.result, 'CHANGED') }}
- name: Logout from ${{ matrix.registry }} container registry
run: skopeo logout ${{ matrix.registry }}
if: ${{ always()
&& steps.skip.outputs.no == 'true'
&& contains(steps.upstream.outputs.result, 'CHANGED') }}