-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (70 loc) · 2.28 KB
/
release.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
name: create release assets
on:
push:
branches:
- main
paths-ignore:
- README.md
- doc/**
- .github/**
- renovate.json5
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: login to ghcr.io
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: Calculate new version with autotag
id: autotag
run: |
curl -sL https://git.io/autotag-install | sh -s -- -b "${RUNNER_TEMP}/bin"
set -x
version=$(${RUNNER_TEMP}/bin/autotag -n)
echo "version=$version" >> $GITHUB_ENV
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3
- name: Build and push
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/planetscale/k8s-node-tagger:v${{ steps.autotag.outputs.version }}
cache-from: |
type=gha,scope=go-cache
cache-to: |
type=gha,mode=max,scope=go-cache
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "v${version}" \
--target main \
--title "v${version}" \
--generate-notes
# - name: Release
# run: |
# set -eou pipefail
# set -x
# image="ghcr.io/planetscale/k8s-node-tagger:v${version}"
# git reset --hard && git clean -ffdx && git pull
# docker buildx build \
# -t "$image" \
# --platform linux/amd64,linux/arm64 \
# --push \
# .
# gh release create "v${version}" --target main --title "v${version}" --generate-notes
# env:
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}