forked from eksctl-io/eksctl
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (89 loc) · 3.36 KB
/
publish-release-type.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
name: Publish Release type
on:
workflow_call:
inputs:
isReleaseCandidate:
required: true
type: boolean
name:
required: true
type: string
secrets:
githubToken:
required: true
slackToken:
required: true
jobs:
publish-release:
name: ${{ inputs.isReleaseCandidate && 'prerelease' || 'release' }}
runs-on: ubuntu-latest
steps:
- name: Free up disk space
run: |
echo "Available storage:"
df -h && echo
sudo docker image prune --all --force
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
echo "Available storage:"
df -h
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 #v5.0.0
with:
go-version: 1.20.x
cache: false
- name: Cache go-build and mod
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 #v3.3.2
with:
path: |
~/.cache/go-build/
~/go/pkg/mod/
key: go-${{ hashFiles('go.sum') }}
restore-keys: |
go-
- name: Setup deps
run: |
make install-build-deps
- name: Publish release
if: ${{ !inputs.isReleaseCandidate }}
env:
GITHUB_TOKEN: ${{ secrets.githubToken }}
run: |
./build/scripts/do-release.sh
- name: Publish release candidate
if: ${{ inputs.isReleaseCandidate }}
env:
GITHUB_TOKEN: ${{ secrets.githubToken }}
run: |
./build/scripts/do-release-candidate.sh
- name: get version
id: get_version
run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: slack on success - team-pitch-black
if: ${{ success() }}
uses: actions-ecosystem/action-slack-notifier@fc778468d09c43a6f4d1b8cccaca59766656996a #v1.1.0
with:
slack_token: ${{ secrets.slackToken }}
message: ":cool-doge: ${{ inputs.name }} successful for tag <https://github.com/eksctl-io/eksctl/releases/tag/${{ steps.get_version.outputs.version }}|${{ steps.get_version.outputs.version }}>"
channel: team-pitch-black
color: green
verbose: false
- name: slack on failure - team-pitch-black
if: ${{ failure() }}
uses: actions-ecosystem/action-slack-notifier@fc778468d09c43a6f4d1b8cccaca59766656996a #v1.1.0
with:
slack_token: ${{ secrets.slackToken }}
message: ":ahhhhhhhhh: ${{ inputs.name }} has failed for tag <https://github.com/eksctl-io/eksctl/releases/tag/${{ steps.get_version.outputs.version }}|${{ steps.get_version.outputs.version }}>"
channel: team-pitch-black
color: red
verbose: true
- name: slack on success - aws-dev
if: ${{ success() }}
uses: actions-ecosystem/action-slack-notifier@fc778468d09c43a6f4d1b8cccaca59766656996a #v1.1.0
with:
slack_token: ${{ secrets.slackToken }}
message: ":tada: <https://github.com/eksctl-io/eksctl/releases/tag/${{ steps.get_version.outputs.version }}|${{ steps.get_version.outputs.version }}> released!"
channel: aws-dev
color: green
verbose: false