-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (67 loc) · 2.01 KB
/
cd.yml
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
name: CD
on:
push:
branches:
- main
workflow_dispatch:
env:
GO_VERSION: 1.22.4
REGISTRY: "ghcr.io"
NAMESPACE: "${{ github.repository }}"
PLATFORMS: linux/amd64,linux/arm64
jobs:
expose-vars:
runs-on: ubuntu-latest
outputs:
GO_VERSION: ${{ env.GO_VERSION }}
REGISTRY: ${{ env.REGISTRY }}
NAMESPACE: ${{ env.NAMESPACE }}
PLATFORMS: ${{ env.PLATFORMS }}
steps:
- name: Exposing env vars
run: echo "Exposing env vars"
release:
uses: ./.github/workflows/release.yml
permissions:
contents: write
pull-requests: write
build:
uses: ./.github/workflows/build.yml
if: ${{ needs.release.outputs.release-created == 'true' }}
needs:
- expose-vars
- release
permissions:
packages: write
contents: write
with:
GO_VERSION: ${{ needs.expose-vars.outputs.GO_VERSION }}
REGISTRY: ${{ needs.expose-vars.outputs.REGISTRY }}
NAMESPACE: ${{ needs.expose-vars.outputs.NAMESPACE }}
PLATFORMS: ${{ needs.expose-vars.outputs.PLATFORMS }}
TAG: ${{ needs.release.outputs.major-tag }}.${{ needs.release.outputs.minor-tag }}.${{ needs.release.outputs.patch-tag }}
MAJOR_TAG: ${{ needs.release.outputs.major-tag }}
MINOR_TAG: ${{ needs.release.outputs.minor-tag }}
PATCH_TAG: ${{ needs.release.outputs.patch-tag }}
artifacts:
runs-on: ubuntu-latest
if: ${{ needs.release.outputs.release-created == 'true' }}
needs:
- expose-vars
- release
- build
permissions:
contents: write
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
pattern: external-dns-midaas-webhook_*
path: ./binaries
merge-multiple: true
- name: Upload Release Artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ needs.release.outputs.tag-name }} $(find ./binaries -type f)