Skip to content

Commit

Permalink
Update test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ecanuto committed Feb 26, 2024
1 parent 90469bb commit 400c475
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 39 deletions.
30 changes: 13 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ jobs:
# uses: ./.github/actions/create-release

steps:
- uses: actions/checkout@v4
- name: Create release draft
uses: ubimetrics/test/.github/actions/create-release@main
uses: ubimetrics/test/.github/actions/create-release@${{ github.ref }}

# Download
download:
Expand All @@ -40,20 +39,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Download
run: echo Download
# - name: Cache image
# uses: actions/cache@v4
# with:
# key: "debian-${{ env.DEBIAN_VERSION }}-${{ env.DEBIAN_VARIANT }}-${{ env.DEBIAN_RELEASE }}"
# path: "*.qcow2"
# id: cache

- name: Test 1
run: echo $DEBIAN_RELEASE
# - name: Download image
# if: steps.cache.outputs.cache-hit != 'true'
# run: echo Downloading file...
# #run: wget "https://cloud.debian.org/images/cloud/$DEBIAN_VERNAME/$DEBIAN_RELEASE/debian-${DEBIAN_VERSION}-${DEBIAN_VARIANT}-${DEBIAN_RELEASE}.qcow2"

- name: Test 2
run: ./builder.sh aaa 111

- name: Test 3
run: echo $DEBIAN_RELEASE

- name: Test 4
run: echo ${{ env.DEBIAN_RELEASE }}

- name: Test 5
run: ./builder.sh bbb 222
# - name: Upload original image artifact
# run: gh release upload "${GITHUB_REF_NAME}" *.qcow2
27 changes: 5 additions & 22 deletions builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,16 @@
DEBIAN_VERSION="12"
DEBIAN_VERNAME="bookworm"
DEBIAN_RELEASE="20240201-1644"

function function_exists() {
declare -F "$1" > /dev/null;
}

function do_relase() {
# echo gh release create "${GITHUB_REF_NAME}" \
# --repo="${GITHUB_REPOSITORY}" \
# --title="${GITHUB_REF_NAME}" \
# --generate-notes \
# --latest \
# --draft

echo gh release create --verify-tag
}

echo "---1"
echo "$@"
echo "---2"
DEBIAN_VARIANT="genericcloud-amd64"

# Export variables to github workflow next steps
cat >> "$GITHUB_ENV" <<-EOF
DEBIAN_VERSION="$DEBIAN_VERSION"
DEBIAN_VERNAME="$DEBIAN_VERNAME"
DEBIAN_RELEASE="$DEBIAN_RELEASE"
DEBIAN_RELEASE="$DEBIAN_VARIANT"
EOF

if [ "$1" == "release" ]; then
do_relase
fi
echo "---1"
echo "$@"
echo "---2"

0 comments on commit 400c475

Please sign in to comment.