-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (121 loc) · 4.37 KB
/
release.yaml
File metadata and controls
129 lines (121 loc) · 4.37 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
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
name: Release vscode-server image
on:
push:
branches:
- master
schedule:
- cron: '0 0 * * 6'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
variant:
- focal
- jammy
- noble
steps:
- run: |
PLATFORM=${{ matrix.platform }}
case ${PLATFORM} in
linux/amd64) VSCODE_OS=cli-alpine-x64;;
linux/arm64) VSCODE_OS=cli-alpine-arm64;;
*) echo "unsupported platform"; exit 1 ;;
esac
echo ARTIFACT_NAME=image-digest-${{ matrix.variant }}-${PLATFORM//\//-} >> $GITHUB_ENV
echo VSCODE_URL="https://code.visualstudio.com/sha/download?build=stable&os=${VSCODE_OS}" >> $GITHUB_ENV
- uses: docker/setup-qemu-action@v4
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v6
id: metadata
with:
images: ghcr.io/${{ github.repository }}
labels: |
org.opencontainers.image.authors=Yang Sheng Han
org.opencontainers.image.documentation=https://github.com/${{ github.repository }}
org.opencontainers.image.title=vscode-server-ubuntu-${{ matrix.variant }}
org.opencontainers.image.vendor=https://github.com/${{ github.repository }}
org.opencontainers.image.version=${{ github.sha }}
tags: |
type=raw,value=latest,enable=${{ matrix.variant == 'noble' }}
type=raw,value=${{ matrix.variant }}
type=schedule,pattern={{date 'YYYYMMDD'}},enable=${{ matrix.variant == 'noble' }}
type=schedule,pattern={{date 'YYYYMMDD'}},suffix=${{ matrix.variant }}
- id: build
uses: docker/build-push-action@v7
with:
build-args: |
DISTRO=ubuntu
VARIANT=${{ matrix.variant }}
VSCODE_URL=${{ env.VSCODE_URL }}
DOCKER_VERSION=27.3.1
GO_VERSION=1.23.2
KUBECTL_VERSION=1.31.0
NODE_VERSION=20.18.0
PYTHON_VERSION=3.13.0
RUST_VERSION=1.82.0
labels: ${{ env.DOCKER_METADATA_OUTPUT_LABELS }}
outputs: type=image,name=ghcr.io/${{ github.repository }},name-canonical=true,push=true,push-by-digest=true
platforms: ${{ matrix.platform }}
- run: |
mkdir -p /tmp/image-digests
touch /tmp/image-digests/${IMAGE_DIGEST#sha256:}
env:
IMAGE_DIGEST: ${{ steps.build.outputs.digest }}
- uses: actions/upload-artifact@v7
with:
compression-level: 0
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}
path: /tmp/image-digests/*
retention-days: 1
release:
runs-on: ubuntu-latest
needs:
- build
strategy:
matrix:
variant:
- focal
- jammy
- noble
steps:
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v6
with:
images: ghcr.io/${{ github.repository }}
labels: |
org.opencontainers.image.authors=Yang Sheng Han
org.opencontainers.image.documentation=https://github.com/${{ github.repository }}
org.opencontainers.image.title=vscode-server-ubuntu-${{ matrix.variant }}
org.opencontainers.image.vendor=https://github.com/${{ github.repository }}
org.opencontainers.image.version=${{ github.sha }}
tags: |
type=raw,value=latest,enable=${{ matrix.variant == 'noble' }}
type=raw,value=${{ matrix.variant }}
type=schedule,pattern={{date 'YYYYMMDD'}},enable=${{ matrix.variant == 'noble' }}
type=schedule,pattern={{date 'YYYYMMDD'}},suffix=${{ matrix.variant }}
- uses: actions/download-artifact@v8
with:
merge-multiple: true
path: /tmp/image-digests
pattern: image-digest-${{ matrix.variant}}-*
- run: |
docker buildx imagetools create \
$(jq --compact-output --raw-output '.tags | map("--tag " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/${{ github.repository }}@sha256:%s ' *)
working-directory: /tmp/image-digests