-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: galal-hussein <[email protected]>
- Loading branch information
1 parent
96deda3
commit 1cdbfff
Showing
5 changed files
with
183 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
on: | ||
push: | ||
paths-ignore: | ||
- "**.md" | ||
- "channel.yaml" | ||
- "install.sh" | ||
- "!.github/workflows/test-suite.yaml" | ||
tags: | ||
- "v*" | ||
|
||
env: | ||
GITHUB_TAG: ${{ github.ref_name }} | ||
|
||
name: Release | ||
permissions: | ||
contents: write | ||
id-token: write | ||
jobs: | ||
release-amd64: | ||
runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }},image=ubuntu22-full-x64,hdd=64 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Dapper | ||
run: | | ||
curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper | ||
chmod +x /usr/local/bin/dapper | ||
- name: Validate Release | ||
run: | | ||
dapper -f Dockerfile --target dapper make validate-release | ||
- name: Build | ||
run: | | ||
dapper -f Dockerfile --target dapper make dapper-ci | ||
- name: "Read secrets" | ||
uses: rancher-eio/read-vault-secrets@main | ||
with: | ||
secrets: | | ||
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials username | DOCKER_USERNAME ; | ||
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials password | DOCKER_PASSWORD ; | ||
- name: Package Images | ||
run: | | ||
dapper -f Dockerfile --target dapper make package-images | ||
- name: Scan Images | ||
run: | | ||
dapper -f Dockerfile --target dapper make scan-images | ||
- name: Test | ||
run: | | ||
dapper -f Dockerfile --target dapper make test | ||
- name: Login to Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ env.DOCKER_USERNAME }} | ||
password: ${{ env.DOCKER_PASSWORD }} | ||
|
||
- name: Publish Image Runtime | ||
run: | | ||
GITHUB_TAG=${{ github.ref_name }} make publish-image-runtime | ||
- name: Checksum Artifacts | ||
run: | | ||
dapper -f Dockerfile --target dapper make checksum | ||
- name: Publish Artifacts | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
dist/artifacts/* | ||
release-arm64: | ||
runs-on: runs-on,runner=8cpu-linux-arm64,run-id=${{ github.run_id }},image=ubuntu22-full-arm64,hdd=64 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Dapper | ||
run: | | ||
curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper | ||
chmod +x /usr/local/bin/dapper | ||
- name: Validate Release | ||
run: | | ||
dapper -f Dockerfile --target dapper make validate-release | ||
- name: Build | ||
run: | | ||
dapper -f Dockerfile --target dapper make dapper-ci | ||
- name: "Read secrets" | ||
uses: rancher-eio/read-vault-secrets@main | ||
with: | ||
secrets: | | ||
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials username | DOCKER_USERNAME ; | ||
secret/data/github/repo/${{ github.repository }}/dockerhub/${{ github.repository_owner }}/credentials password | DOCKER_PASSWORD ; | ||
- name: Package Images | ||
run: | | ||
dapper -f Dockerfile --target dapper make package-images | ||
- name: Scan Images | ||
run: | | ||
dapper -f Dockerfile --target dapper make scan-images | ||
- name: Login to Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ env.DOCKER_USERNAME }} | ||
password: ${{ env.DOCKER_PASSWORD }} | ||
|
||
- name: Publish Image Runtime | ||
run: | | ||
GITHUB_TAG=${{ github.ref_name }} make publish-image-runtime | ||
- name: Checksum Artifacts | ||
run: | | ||
dapper -f Dockerfile --target dapper make checksum | ||
- name: Publish Artifacts | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
dist/artifacts/* | ||
dispatch: | ||
needs: [release-amd64, release-arm64] | ||
runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }},image=ubuntu22-full-x64,hdd=64 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Dapper | ||
run: | | ||
curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper | ||
chmod +x /usr/local/bin/dapper | ||
- name: "Read secrets" | ||
uses: rancher-eio/read-vault-secrets@main | ||
with: | ||
secrets: | | ||
secret/data/github/repo/${{ github.repository }}/pat_username/credentials token | PAT_USERNAME ; | ||
- name: Dispatch | ||
run: | | ||
dapper -f Dockerfile --target dapper make dispatch | ||
env: | ||
PAT_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PATH_USERNAME: ${{ env.PAT_USERNAME }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
cd $(dirname $0)/.. | ||
|
||
source ./scripts/version.sh | ||
|
||
CHECKSUM_DIR=${CHECKSUM_DIR:-./dist/artifacts} | ||
|
||
function checksum(){ | ||
|
||
sumfile="${CHECKSUM_DIR}/sha256sum-${ARCH}.txt" | ||
echo -n "" > "${sumfile}" | ||
|
||
files=$(ls ${CHECKSUM_DIR}) | ||
for file in ${files}; do | ||
sha256sum "${file}" | sed "s;$(dirname ${file})/;;g" >> "${sumfile}" | ||
done | ||
|
||
cat "${sumfile}" | ||
} | ||
|
||
|
||
checksum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters