-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
84 additions
and
43 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 |
---|---|---|
@@ -1,66 +1,107 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- v* | ||
- debian* | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
DEBIAN_VERSION: 12 | ||
DEBIAN_VERNAME: bookworm | ||
DEBIAN_RELEASE: 20240201-1644 | ||
|
||
GCLOUD_IMAGE_NAME: debian-${{ env.DEBIAN_VERSION }}-genericcloud-amd64-${{ env.DEBIAN_RELEASE }}.qcow2 | ||
GAGENT_IMAGE_NAME: debian-${{ env.DEBIAN_VERSION }}-grafanaagent-amd64-${{ env.DEBIAN_RELEASE }}.qcow2 | ||
DOCKER_IMAGE_NAME: debian-${{ env.DEBIAN_VERSION }}-docker-amd64-${{ env.DEBIAN_RELEASE }}.qcow2 | ||
|
||
GCLOUD_IMAGE_URL: "https://cloud.debian.org/images/cloud/bookworm/20240201-1644/debian-12-genericcloud-amd64-20240201-1644.qcow2" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
# create-release: | ||
# runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Create release draft | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release create "${GITHUB_REF_NAME}" \ | ||
--repo="${GITHUB_REPOSITORY}" \ | ||
--title="${GITHUB_REF_NAME}" \ | ||
--generate-notes \ | ||
--latest \ | ||
--draft | ||
build-cloudimage: | ||
# steps: | ||
# - name: Create release draft | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# run: | | ||
# gh release create "${GITHUB_REF_NAME}" \ | ||
# --repo="${GITHUB_REPOSITORY}" \ | ||
# --title="${GITHUB_REF_NAME}" \ | ||
# --generate-notes \ | ||
# --latest \ | ||
# --draft | ||
|
||
download-base-image: | ||
runs-on: ubuntu-latest | ||
needs: release | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Cache image | ||
uses: actions/cache@v4 | ||
id: cache | ||
with: | ||
path: ${{ env.GCLOUD_IMAGE_NAME }} | ||
key: ${{ env.GCLOUD_IMAGE_NAME }} | ||
|
||
- name: Download image | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: wget -O "${GCLOUD_IMAGE_NAME}" "${GCLOUD_IMAGE_URL}" | ||
|
||
- name: Build image | ||
run: | | ||
echo "cloudimage" > build.log | ||
cat README.md | ||
# - name: Download image | ||
# if: steps.cache.outputs.cache-hit != 'true' | ||
# run: wget -O "$IMAGE_FILE" "$IMAGE_PATH" | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: debian-cloudimage | ||
path: build.log | ||
retention-days: 1 | ||
# build-cloudimage: | ||
# runs-on: ubuntu-latest | ||
# needs: release | ||
|
||
publish-cloudimage: | ||
runs-on: ubuntu-latest | ||
needs: build-cloudimage | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v4 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
# - name: Install libguestfs | ||
# run: | | ||
# sudo apt-get update -y | ||
# sudo apt-get install -y libguestfs-tools | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: debian-cloudimage | ||
# - name: Download image | ||
# run: | | ||
# source settings.sh | ||
# wget -O "$IMAGE_FILE" "$IMAGE_PATH" | ||
|
||
# - name: Build image | ||
# run: | | ||
# echo "cloudimage" > build.log | ||
# cat README.md | ||
|
||
# - name: Upload artifacts | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: debian-cloudimage | ||
# path: build.log | ||
# retention-days: 1 | ||
|
||
# publish-cloudimage: | ||
# runs-on: ubuntu-latest | ||
# needs: build-cloudimage | ||
|
||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v4 | ||
|
||
# - name: Download artifacts | ||
# uses: actions/download-artifact@v4 | ||
# with: | ||
# name: debian-cloudimage | ||
|
||
- name: Publish image | ||
run: | | ||
cat build.log | ||
cat README.md | ||
# - name: Publish image | ||
# run: | | ||
# cat build.log | ||
# cat README.md | ||
|
||
|