forked from rancher-sandbox/rancher-desktop
-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (57 loc) · 2.16 KB
/
linux-release.yaml
File metadata and controls
60 lines (57 loc) · 2.16 KB
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
name: Upload Linux release
on:
release:
types:
- published
workflow_dispatch: {}
defaults:
run:
shell: bash
jobs:
linux-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: 0
- name: Populate necessary env vars
run: |
# get the env vars
version_with_v=${GITHUB_REF#"refs/tags/"}
release_zip_name="rancher-desktop-linux-${version_with_v}.zip"
major_minor=$(echo ${version_with_v} | sed -E 's/v([0-9]+\.[0-9]+)\.[0-9]+.*/\1/g')
s3_zip_name="rancher-desktop-linux-${major_minor}.zip"
# make variables available in subsequent steps
echo "version_with_v=$version_with_v" >> $GITHUB_ENV
echo "release_zip_name=$release_zip_name" >> $GITHUB_ENV
echo "major_minor=$major_minor" >> $GITHUB_ENV
echo "s3_zip_name=$s3_zip_name" >> $GITHUB_ENV
- run: mkdir -p dist
- name: Fetch the .zip file from release
run: >-
curl -L -o "dist/${release_zip_name}"
"https://github.com/${repository}/releases/download/${version_with_v}/${release_zip_name}"
env:
repository: ${{ github.repository }}
version_with_v: ${{ env.version_with_v }}
release_zip_name: ${{ env.release_zip_name }}
- name: Upload zip file to S3
run: >-
aws s3 cp
"dist/${release_zip_name}"
"s3://rancher-desktop-assets-for-obs/${s3_zip_name}"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
release_zip_name: ${{ env.release_zip_name }}
s3_zip_name: ${{ env.s3_zip_name }}
- name: Trigger OBS services for relevant package in stable channel
run: >-
curl -X POST
-H "Authorization: Token ${OBS_WEBHOOK_TOKEN}"
"https://build.opensuse.org/trigger/runservice?project=isv:Rancher:stable&package=rancher-desktop-${MAJOR_MINOR}"
env:
MAJOR_MINOR: ${{ env.major_minor }}
OBS_WEBHOOK_TOKEN: ${{ secrets.OBS_WEBHOOK_TOKEN }}