-
Notifications
You must be signed in to change notification settings - Fork 68
120 lines (96 loc) · 3.71 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
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
name: release
env:
ACTIONS_STEP_DEBUG: true
on:
push:
tags:
- '**'
jobs:
package:
runs-on: ubuntu-20.04
steps:
- name: Maximise free space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/.ghcup
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Check free space
run: df -h
- name: Checkout Datashim
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Generate short SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set Git user
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@user.noreply.github.com"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ${{ vars.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Dataset operator image
run: |
cd src/dataset-operator
./build_multiarch_dataset_operator.sh -p ${{ vars.REGISTRY_URL }} ${{ github.ref_name }}
- name: Build and push Generate Keys image
run: |
cd src/generate-keys
./build_multiarch_generate_keys.sh -p ${{ vars.REGISTRY_URL }} ${{ github.ref_name }}
docker buildx prune
- name: Build and push bundled CSI S3
run: |
cd src/csi-s3
./build_and_push_multiarch_csis3.sh ${{ vars.REGISTRY_URL }} ${{ steps.vars.outputs.sha_short }}
docker buildx prune
- name: Build and push bundled CSI NFS
run: |
cd src/csi-driver-nfs
./build_and_push_multiarch_csinfs.sh ${{ vars.REGISTRY_URL }} ${{ steps.vars.outputs.sha_short }}
docker buildx prune
- name: Build and push COS uploader image
run: |
cd src/cos-uploader
./build_multiarch_cos_uploader.sh -p ${{ vars.REGISTRY_URL }} ${{ github.ref_name }}
- name: Install Helm
uses: azure/setup-helm@v3
- name: Modify Helm values
uses: mikefarah/yq@master
with:
cmd: yq --inplace '
with (.dataset-operator-chart.datasetoperator.tag;
. = "${{ github.ref_name }}" ) |
with (.dataset-operator-chart.generatekeys.tag;
. = "${{ github.ref_name }}" ) |
with (.csi-s3-chart.csis3.tag;
. = "${{ steps.vars.outputs.sha_short }}" ) |
with (.csi-nfs-chart.csinfs.tag;
. = "${{ steps.vars.outputs.sha_short }}" ) ' chart/values.yaml
- name: Create Helm package
run: |
cd chart
helm package --version ${{ github.ref_name }} --app-version ${{ github.ref_name }} -u -d ../.cr-release-packages .
- name: Run chart releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
charts_dir: chart
skip_packaging: true
charts_repo_url: https://datashim-io.github.io/datashim
- name: Create a release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: true
prerelease: true
automatic_release_tag: "${{ github.ref_name }}"