-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (78 loc) · 2.49 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
84
85
86
87
88
89
90
91
name: release
on:
push:
tags: ["*"]
workflow_dispatch:
permissions:
contents: write
packages: write
pull-requests: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GHCR_REPO: ghcr.io/${{ github.repository_owner }}/arbctl
jobs:
release-image:
runs-on: "ubuntu-latest"
steps:
- name: checkout
uses: actions/checkout@v4
- name: login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
id: docker-builder
uses: docker/setup-buildx-action@v3
- name: docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.GHCR_REPO }}
tags: |
type=ref,event=branch
type=ref,event=branch,suffix=-${{ github.run_number }}
type=ref,event=tag
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=sha,format=short,prefix=
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
- name: build with cache and push images
uses: docker/build-push-action@v3
id: docker_build
with:
context: .
builder: ${{ steps.docker-builder.outputs.name }}
push: ${{ github.event_name != 'pull_request' }}
cache-from: |
type=registry,ref=${{ env.GHCR_REPO }}:latest
tags: ${{ steps.meta.outputs.tags }}
make-release:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: build changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v3
with:
configuration: .github/changelog-builder.json
ignorePreReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: make release
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body: |
${{ steps.changelog.outputs.changelog }}
allowUpdates: true
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') || contains(github.ref, 'pre') }}
draft: true