This repository was archived by the owner on Feb 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (77 loc) · 2.52 KB
/
release.yml
File metadata and controls
80 lines (77 loc) · 2.52 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
name: release
on:
workflow_dispatch:
inputs:
version:
description: 'Buildx version (e.g. v0.8.1)'
required: true
dry-run:
description: 'Dry run'
required: true
type: boolean
env:
REPO_SLUG: "dockereng/buildx-pkg"
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Set Buildx version
run: |
echo "BUILDX_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
-
name: Dump context
uses: crazy-max/ghaction-dump-context@v1
-
name: Checkout
uses: actions/checkout@v3
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.REPO_SLUG }}
tags: |
type=raw,value=${{ env.BUILDX_VERSION }}
type=raw,value=${{ env.BUILDX_VERSION }}-${{ github.run_number }}
labels: |
github.buildx-packaging.run_id=${{ github.run_id }}
github.buildx-packaging.run_number=${{ github.run_number }}
bake-target: meta-helper
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
if: github.event.inputs.dry-run != 'true'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build
uses: docker/bake-action@v2
with:
files: |
./docker-bake.hcl
${{ steps.meta.outputs.bake-file }}
targets: pkg-cross
set: |
*.output=type=image,push=${{ github.event.inputs.dry-run != 'true' }}
-
name: Create Release
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
if: github.event.inputs.dry-run != 'true'
with:
name: ${{ env.BUILDX_VERSION }}-${{ github.run_number }}
tag_name: ${{ env.BUILDX_VERSION }}-${{ github.run_number }}
target_commitish: ${{ github.sha }}
body: |
* Tags pushed: [`${{ env.REPO_SLUG }}:${{ env.BUILDX_VERSION }}`, `${{ env.REPO_SLUG }}:${{ env.BUILDX_VERSION }}-${{ github.run_number }}`](https://hub.docker.com/r/${{ env.REPO_SLUG }})
* Buildx release: https://github.com/docker/buildx/releases/tag/${{ env.BUILDX_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}