Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ecanuto authored Feb 24, 2024
1 parent 9ce4b96 commit 5f9a171
Showing 1 changed file with 84 additions and 43 deletions.
127 changes: 84 additions & 43 deletions .github/workflows/release.yml
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


0 comments on commit 5f9a171

Please sign in to comment.