44# Licensed under the Apache License, Version 2.0 (the "License");
55# you may not use this file except in compliance with the License.
66# You may obtain a copy of the License at
7- #
7+ #
88# http://www.apache.org/licenses/LICENSE-2.0
99#
1010# Unless required by applicable law or agreed to in writing, software
1414# limitations under the License.
1515# ------------------------------------------------------------
1616
17+ # yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
18+ ---
1719name : Publish Recipes
1820
1921on :
@@ -39,29 +41,35 @@ jobs:
3941 contents : read
4042 packages : write
4143 steps :
42- - name : Check out repo
43- uses : actions/checkout@v3
44- - name : Parse release version and set environment variables
45- run : python ./.github/scripts/get_release_version.py
46- - name : Set up ORAS
47- uses : oras-project/setup-oras@v1
48- with :
49- version : ' 1.2.0'
50- - name : Verify ORAS installation
51- run : oras version
52- - name : Download rad CLI
53- run : |
54- echo "Downloading latest rad CLI"
55- wget -q "${{ env.RAD_CLI_URL }}" -O - | /bin/bash -s edge
56- - name : Login to GitHub Container Registry
57- uses : docker/login-action@v2
58- with :
59- registry : ghcr.io
60- username : ${{ github.actor }}
61- password : ${{ secrets.GITHUB_TOKEN }}
62- - name : Publish Recipes to GHCR
63- # Uses REL_VERSION as the recipe version so PR builds result in a `pr-<pr number>` tag
64- run : ./.github/scripts/publish-recipes.sh radius-project dev/recipes ${{ env.REL_VERSION }}
44+ - name : Check out repo
45+ uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
46+
47+ - name : Parse release version and set environment variables
48+ run : python ./.github/scripts/get_release_version.py
49+
50+ - name : Set up ORAS
51+ uses : oras-project/setup-oras@22ce207df3b08e061f537244349aac6ae1d214f6 # v1.2.4
52+ with :
53+ version : " 1.2.0"
54+
55+ - name : Verify ORAS installation
56+ run : oras version
57+
58+ - name : Download rad CLI
59+ run : |
60+ echo "Downloading latest rad CLI"
61+ wget -q "${{ env.RAD_CLI_URL }}" -O - | /bin/bash -s edge
62+
63+ - name : Login to GitHub Container Registry
64+ uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
65+ with :
66+ registry : ghcr.io
67+ username : ${{ github.actor }}
68+ password : ${{ secrets.GITHUB_TOKEN }}
69+
70+ - name : Publish Recipes to GHCR
71+ # Uses REL_VERSION as the recipe version so PR builds result in a `pr-<pr number>` tag
72+ run : ./.github/scripts/publish-recipes.sh radius-project dev/recipes ${{ env.REL_VERSION }}
6573
6674 delete-dev :
6775 name : Delete GHCR recipes - Dev
@@ -72,55 +80,64 @@ jobs:
7280 contents : read
7381 packages : write
7482 steps :
75- - name : Check out repo
76- uses : actions/checkout@v3
77- - name : Parse release version and set environment variables
78- run : python ./.github/scripts/get_release_version.py
79- - name : Login to GitHub Container Registry
80- uses : docker/login-action@v2
81- with :
82- registry : ghcr.io
83- username : ${{ github.actor }}
84- password : ${{ secrets.GITHUB_TOKEN }}
85- - name : Delete Recipes from GHCR
86- # Uses REL_VERSION as the recipe version so PR builds result in a `pr-<pr number>` tag
87- run : ./.github/scripts/delete-recipes.sh radius-project dev/recipes ${{ env.REL_VERSION }}
83+ - name : Check out repo
84+ uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
85+
86+ - name : Parse release version and set environment variables
87+ run : python ./.github/scripts/get_release_version.py
88+
89+ - name : Login to GitHub Container Registry
90+ uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
91+ with :
92+ registry : ghcr.io
93+ username : ${{ github.actor }}
94+ password : ${{ secrets.GITHUB_TOKEN }}
95+
96+ - name : Delete Recipes from GHCR
97+ # Uses REL_VERSION as the recipe version so PR builds result in a `pr-<pr number>` tag
98+ run : ./.github/scripts/delete-recipes.sh radius-project dev/recipes ${{ env.REL_VERSION }}
8899
89100 # This is where we can add integration tests in the future
90101
91102 publish-public :
92103 if : github.event_name != 'pull_request'
93104 name : Publish Recipes to GHCR - Public
94105 runs-on : ubuntu-latest
95- environment :
106+ environment :
96107 name : Public
97108 permissions :
98109 contents : read
99110 packages : write
100111 steps :
101- - name : Check out repo
102- uses : actions/checkout@v3
103- - name : Parse release version and set environment variables
104- run : python ./.github/scripts/get_release_version.py
105- - name : Set up ORAS
106- uses : oras-project/setup-oras@v1
107- with :
108- version : ' 1.2.0'
109- - name : Verify ORAS installation
110- run : oras version
111- - name : Download rad CLI
112- run : |
113- echo "Downloading latest rad CLI"
114- wget -q "${{ env.RAD_CLI_URL }}" -O - | /bin/bash -s edge
115- - name : Login to GitHub Container Registry
116- uses : docker/login-action@v2
117- with :
118- registry : ghcr.io
119- username : ${{ github.actor }}
120- password : ${{ secrets.GITHUB_TOKEN }}
121- - name : Publish Recipes to GHCR
122- run : |
123- ./.github/scripts/publish-recipes.sh radius-project recipes ${{ env.REL_CHANNEL }}
124- if [ "${{ env.REL_TAG }}" != "${{ env.REL_CHANNEL }}" ]; then
125- ./.github/scripts/publish-recipes.sh radius-project recipes ${{ env.REL_TAG }}
126- fi
112+ - name : Check out repo
113+ uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
114+
115+ - name : Parse release version and set environment variables
116+ run : python ./.github/scripts/get_release_version.py
117+
118+ - name : Set up ORAS
119+ uses : oras-project/setup-oras@22ce207df3b08e061f537244349aac6ae1d214f6 # v1.2.4
120+ with :
121+ version : " 1.2.0"
122+
123+ - name : Verify ORAS installation
124+ run : oras version
125+
126+ - name : Download rad CLI
127+ run : |
128+ echo "Downloading latest rad CLI"
129+ wget -q "${{ env.RAD_CLI_URL }}" -O - | /bin/bash -s edge
130+
131+ - name : Login to GitHub Container Registry
132+ uses : docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
133+ with :
134+ registry : ghcr.io
135+ username : ${{ github.actor }}
136+ password : ${{ secrets.GITHUB_TOKEN }}
137+
138+ - name : Publish Recipes to GHCR
139+ run : |
140+ ./.github/scripts/publish-recipes.sh radius-project recipes ${{ env.REL_CHANNEL }}
141+ if [ "${{ env.REL_TAG }}" != "${{ env.REL_CHANNEL }}" ]; then
142+ ./.github/scripts/publish-recipes.sh radius-project recipes ${{ env.REL_TAG }}
143+ fi
0 commit comments