Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ecanuto committed Mar 9, 2024
1 parent 78ed68d commit 3de4c20
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
41 changes: 20 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,35 +52,34 @@ jobs:
- name: Create a new GitHub Release
run: |
# Create a new GitHub Release if it does not exists
gh release list | grep "v${DEBIAN_VERSION}-${DEBIAN_RELEASE}" ||
gh release create "v${DEBIAN_VERSION}-${DEBIAN_RELEASE}" \
gh release list | grep "${GITHUB_RELEASE}" ||
gh release create "${GITHUB_RELEASE}" \
--repo="${GITHUB_REPOSITORY}" \
--title="v${DEBIAN_VERSION}-${DEBIAN_RELEASE}" \
--title="${GITHUB_RELEASE}" \
--latest \
--draft
customize:
name: Customize image
needs: download
runs-on: ubuntu-latest

# customize:
# name: Customize image
# needs: download
# runs-on: ubuntu-latest

# strategy:
# matrix:
# variant: [qemu, locales, extras]
strategy:
matrix:
variant: [qemu, locales, extras]

# steps:
# - name: Checkout
# uses: actions/checkout@v4
steps:
- name: Checkout
uses: actions/checkout@v4

# - name: Load settings
# run: source settings.sh
- name: Load settings
run: source settings.sh ${{ matrix.variant }}

# - name: Load cached files
# uses: actions/cache@v4
# with:
# key: ${{ env.GIT_CACHE_NAME }}
# path: ${{ env.IMAGE_FILENAME }}
- name: Load cached files
uses: actions/cache@v4
with:
key: ${{ env.GIT_CACHE_NAME }}
path: ${{ env.IMAGE_FILENAME }}

# - name: Install libguestfs
# run: sudo apt-get install -y libguestfs-tools
Expand Down
10 changes: 6 additions & 4 deletions settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ DEBIAN_FILEURL="$DEBIAN_BASEURL/$DEBIAN_VERNAME/$DEBIAN_RELEASE/debian-${DEBIAN_
# Image filename
IMAGE_FILENAME=$(basename $DEBIAN_FILEURL)

# Release name
# GitHub cache
GIT_CACHE_NAME="debian-$DEBIAN_VERSION-$DEBIAN_VARIANT-$DEBIAN_RELEASE"

# GitHub release name
if [[ "${GITHUB_REF_NAME}" == "refs/tags/*" ]]; then
GITHUB_RELEASE="${GITHUB_REF_NAME}"
else
GITHUB_RELEASE="v${DEBIAN_VERSION}-${DEBIAN_RELEASE}"
fi

echo ">>> $GITHUB_RELEASE"
echo ">>> $1"

# packages=(
# [qemu]=qemu-guest-agent
Expand All @@ -30,8 +33,6 @@ echo ">>> $GITHUB_RELEASE"

# IMAGE_REF_NAME="v${DEBIAN_VERSION}-${DEBIAN_RELEASE}"

# Github cache
GIT_CACHE_NAME="debian-$DEBIAN_VERSION-$DEBIAN_VARIANT-$DEBIAN_RELEASE"

# Export variables to github workflow
if [[ -f "$GITHUB_ENV" ]]; then
Expand All @@ -43,5 +44,6 @@ cat >> "$GITHUB_ENV" <<-EOF
DEBIAN_FILEURL=$DEBIAN_FILEURL
IMAGE_FILENAME=$IMAGE_FILENAME
GIT_CACHE_NAME=$GIT_CACHE_NAME
GITHUB_RELEASE=$GITHUB_RELEASE
EOF
fi

0 comments on commit 3de4c20

Please sign in to comment.