-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (136 loc) · 5.25 KB
/
docker-nightly.yaml
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
148
149
150
151
152
153
---
name: Docker Nightly Builder
"on":
push:
branches:
- trunk
pull_request:
branches:
- trunk
schedule:
- cron: "0 0 * * *" # build nightly!
jobs:
nightly:
name: Nightly
runs-on: ubuntu-latest
strategy:
matrix:
build:
- alpine
- debian
- ubuntu
include:
- build: alpine
target_triple: x86_64-unknown-linux-musl
dockerfile: alpine/Dockerfile
docker_target_platforms: linux/amd64
tag_bare: alpine
tag_version: alpine3
- build: debian
target_triple: x86_64-unknown-linux-gnu
dockerfile: debian/bookworm/slim/Dockerfile
docker_target_platforms: linux/amd64,linux/arm64
tag_bare: slim
tag_version: slim-bookworm
- build: ubuntu
target_triple: x86_64-unknown-linux-gnu
dockerfile: ubuntu/jammy/Dockerfile
docker_target_platforms: linux/amd64,linux/arm64
tag_bare: ubuntu
tag_version: ubuntu-jammy
steps:
- uses: actions/[email protected]
- name: Clone Artichoke
uses: actions/[email protected]
with:
repository: artichoke/artichoke
path: artichoke
- name: Set Artichoke latest commit
id: latest
working-directory: artichoke
run: |
echo "Artichoke git ref: $(git rev-parse HEAD)"
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Setup Python
uses: actions/[email protected]
with:
python-version: "3.11"
- name: Set Artichoke Rust toolchain version
id: rust_toolchain
working-directory: artichoke
shell: python
run: |
import os
import tomllib
with open("rust-toolchain.toml", "rb") as f:
data = tomllib.load(f)
toolchain = data["toolchain"]["channel"]
print(f"Rust toolchain version: {toolchain}")
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
print(f"version={toolchain}", file=f)
- name: Set labels
id: labels
working-directory: artichoke
shell: python
run: |
import datetime
import os
import tomllib
with open("Cargo.toml", "rb") as f:
data = tomllib.load(f)
version = data["package"]["version"]
version = f"{version}-nightly"
print(f"Artichoke version: {version}")
current_time = datetime.datetime.now(datetime.timezone.utc)
build_timestamp = current_time.isoformat()
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
print(f"artichoke_version={version}", file=f)
print(f"build_timestamp={build_timestamp}", file=f)
- name: Generate THIRDPARTY license listing
uses: artichoke/[email protected]
with:
artichoke_ref: ${{ steps.latest.outputs.commit }}
target_triple: ${{ matrix.target_triple }}
output_file: ${{ github.workspace }}/THIRDPARTY
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- name: Login to DockerHub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
if: github.ref == 'refs/heads/trunk'
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0
with:
context: .
platforms: ${{ matrix.docker_target_platforms }}
file: ${{ matrix.dockerfile }}
push: ${{ github.ref == 'refs/heads/trunk' }}
tags: |
artichokeruby/artichoke:${{ matrix.tag_bare }}-nightly
artichokeruby/artichoke:${{ matrix.tag_version }}-nightly
build-args: |
ARTICHOKE_NIGHTLY_REVISION=${{ steps.latest.outputs.commit }}
ARTICHOKE_NIGHTLY_VERSION=${{ steps.labels.outputs.artichoke_version }}
BUILD_TIMESTAMP=${{ steps.labels.outputs.build_timestamp }}
RUST_VERSION=${{ steps.rust_toolchain.outputs.version }}
- name: Build and push Docker images (Ubuntu extra tags)
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0
if: matrix.build == 'ubuntu'
with:
context: .
platforms: ${{ matrix.docker_target_platforms }}
file: ${{ matrix.dockerfile }}
push: ${{ github.ref == 'refs/heads/trunk' }}
tags: |
artichokeruby/artichoke:latest
artichokeruby/artichoke:ubuntu22.04-nightly
build-args: |
ARTICHOKE_NIGHTLY_REVISION=${{ steps.latest.outputs.commit }}
ARTICHOKE_NIGHTLY_VERSION=${{ steps.labels.outputs.artichoke_version }}
BUILD_TIMESTAMP=${{ steps.labels.outputs.build_timestamp }}
RUST_VERSION=${{ steps.rust_toolchain.outputs.version }}