forked from radius-project/radius
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (94 loc) · 3.96 KB
/
assets.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
91
92
93
94
95
96
97
# ------------------------------------------------------------
# Copyright 2023 The Radius Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------
name: assets
on:
push:
branches:
- main
tags:
- v*
jobs:
publish:
name: Assets
runs-on: ubuntu-latest
if: github.repository == 'radius-project/radius'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Parse release version and set environment variables
run: python ./.github/scripts/get_release_version.py
# The install scripts are not versioned. They go to tools/rad/install.{sh,ps1}
- name: Upload install.sh
uses: bacongobbler/[email protected]
with:
source_dir: 'deploy'
container_name: 'tools'
connection_string: ${{ secrets.ASSETS_STORAGE_CONNECTION_STRING }}
overwrite: 'true'
extra_args: '--destination-path rad --pattern install.sh'
- name: Upload install.ps1
uses: bacongobbler/[email protected]
with:
source_dir: 'deploy'
container_name: 'tools'
connection_string: ${{ secrets.ASSETS_STORAGE_CONNECTION_STRING }}
overwrite: 'true'
extra_args: '--destination-path rad --pattern install.ps1'
- name: Upload Grafana dashboard
uses: bacongobbler/[email protected]
with:
source_dir: 'grafana'
container_name: 'tools'
connection_string: ${{ secrets.ASSETS_STORAGE_CONNECTION_STRING }}
overwrite: 'true'
extra_args: '--destination-path grafana --pattern *.json --timeout 300'
# Logic: If this is a real release (tagged, non-rc) then compare to our existing full
# release and see if it's newer. This prevents a patch release of an older vintage from overwriting
# a newer release
- name: Download version marker file
run: |
curl https://get.radapp.dev/version/stable.txt -o current-stable.txt
if: ${{ success() && env.UPDATE_RELEASE == 'true' }}
- name: Get version
id: setcurrentversion
if: ${{ success() && env.UPDATE_RELEASE == 'true' }}
run: echo "version=$(cat current-stable.txt)" >> $GITHUB_OUTPUT
- name: Compare versions
uses: madhead/semver-utils@latest
if: ${{ success() && env.UPDATE_RELEASE == 'true' }}
id: compare
with:
version: ${{ env.REL_CHANNEL }}.0
compare-to: ${{ steps.setcurrentversion.outputs.version }}.0
- name: Print info (for sanity)
if: ${{ success() && env.UPDATE_RELEASE == 'true' }}
run: |
echo "current stable channel: ${{ steps.setcurrentversion.outputs.version }}"
echo "this build channel: ${{ env.REL_CHANNEL }}"
echo "comparison: ${{ steps.compare.outputs.comparison-result }}"
- name: Write stable.txt
if: ${{ success() && steps.compare.outputs.comparison-result == '>' }}
run: |
echo $REL_CHANNEL > stable.txt
- name: 'Update latest version marker'
uses: bacongobbler/[email protected]
if: ${{ success() && steps.compare.outputs.comparison-result == '>' }}
with:
container_name: 'version'
connection_string: ${{ secrets.ASSETS_STORAGE_CONNECTION_STRING }}
overwrite: 'true'
source_dir: .
extra_args: '--pattern stable.txt'