-
Notifications
You must be signed in to change notification settings - Fork 487
128 lines (114 loc) · 4.08 KB
/
publish.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Publish
on:
# workflow_run only triggers for default branch (master/main)
workflow_run:
workflows: [CI]
types: [completed]
workflow_dispatch:
inputs:
installer_version:
required: false # Is this required if I have a default?
description: "The version of Fluvio to download with install.sh"
default: "stable"
workflow_call:
inputs:
installer_version:
required: false
type: string
description: "The version of Fluvio to download with install.sh"
default: "stable"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE: true # Needed so `make` targets make public changes
jobs:
# Re-tag the docker image for this commit as 'latest'
docker:
name: Publish Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish latest development Fluvio Image
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: make docker-push-manifest-dev
- name: Slack Notification
uses: 8398a7/action-slack@v3
if: failure()
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}
# Download the `fluvio` release artifact for each target and publish them to packages.fluvio.io
fluvio:
name: Publish Fluvio CLI
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
BPKG_TOKEN: ${{ secrets.BPKG_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install fluvio-package
env:
CHANNEL_TAG: stable # We want to ensure we install the stable version of CLI
run: |
if [ -n "${{ github.event.inputs.installer_version }}" ]; then
export VERSION=${{ github.event.inputs.installer_version }}
else
export VERSION=stable
fi
echo "VERSION=$VERSION"
make curl-install-fluvio
make install-fluvio-package
- name: Download dev release
run: make download-fluvio-release
- name: Publish artifacts
env:
BPKG_TOKEN: ${{ secrets.BPKG_TOKEN }}
FLUVIO_BIN: ~/.fluvio/bin/fluvio
run: make publish-artifacts-dev
- name: Slack Notification
uses: 8398a7/action-slack@v3
if: failure()
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}
# Bump the latest version of the Fluvio CLI on the package registry
# This serves as the final step in the publishing process, and therefore
# depends on all other jobs to have completed successfully.
# If the 'latest' tag gets bumped, you can be sure the whole publish flow succeeded.
bump_fluvio:
name: Bump Fluvio CLI version
needs: [docker, fluvio]
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install stable Fluvio CLI
env:
CHANNEL_TAG: stable
run: |
make curl-install-fluvio
- name: Bump latest version of Fluvio CLI with fluvio-packages
env:
BPKG_TOKEN: ${{ secrets.BPKG_TOKEN }}
FLUVIO_BIN: ~/.fluvio/bin/fluvio
run: make bump-fluvio-latest
- name: Slack Notification
uses: 8398a7/action-slack@v3
if: ${{ !success() }}
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
MATRIX_CONTEXT: ${{ toJson(matrix) }}