generated from crossplane/upjet-provider-template
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (60 loc) · 2.02 KB
/
release.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
name: Release
on:
push:
tags:
- "*.*"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
label-detector:
name: Runner Label
runs-on: label-detector
outputs:
runs-on: ${{ steps.detector.outputs.label }}
steps:
- name: Detect Label
id: detector
run: |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idoutputs
echo "label=$(curl -fsSL https://this-is-nats.appscode.ninja/runs-on/${{ github.repository_owner }}?visibility=${{ github.repository_visibility }})" >> $GITHUB_OUTPUT
build:
name: Build
needs: label-detector
runs-on: "${{ needs.label-detector.outputs.runs-on }}"
steps:
- uses: actions/checkout@v1
- run: git checkout -b release-${GITHUB_REF_NAME}
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: '1.21'
id: go
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Prepare Host
run: |
sudo apt-get -qq update || true
sudo apt-get install -y unzip
GOBIN=/usr/local/bin go install golang.org/x/tools/cmd/goimports@latest
- name: Publish to GitHub Container Registry
env:
REGISTRY: ghcr.io/kubedb
DOCKER_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
USERNAME: 1gtm
APPSCODE_ENV: prod
run: |
docker login ghcr.io --username ${USERNAME} --password ${DOCKER_TOKEN}
make submodules
make generate
make build.all
make publish
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.event.ref, 'refs/tags/') && (contains(github.ref, '-alpha.') || contains(github.ref, '-beta.')) == false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}