Skip to content

Commit

Permalink
Some cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
  • Loading branch information
frelon committed Feb 15, 2024
1 parent 48be0dc commit 80f862f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 deletions.
24 changes: 1 addition & 23 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
tags:
- v**
pull_request:
pull_request_target:
types:
- opened
- synchronize
Expand Down Expand Up @@ -50,17 +50,12 @@ jobs:
env:
PLATFORM: ${{ needs.detect.outputs.platform }}
TOOLKIT_REPO: ghcr.io/${{github.repository}}/elemental-cli
outputs:
version: ${{ steps.set-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.merge_commit_sha }}"
- run: |
git fetch --prune --unshallow
- id: set-version
run: |
echo "version="$(git describe --tags --candidates=50) >> $GITHUB_OUTPUT
- name: Log in to ghcr.io
uses: docker/login-action@v3
with:
Expand All @@ -82,20 +77,3 @@ jobs:
uses: ./.github/workflows/build_and_test_x86.yaml
with:
flavor: ${{ matrix.flavor }}

# TODO: use integer package-version-id instead of tag.
# cleanup:
# runs-on: ubuntu-latest
# permissions:
# packages: write
# needs:
# - build-toolkit
# - build-matrix
# steps:
# - uses: actions/delete-package-versions@v4
# if: ${{ !startsWith(github.event.ref, 'refs/tags/v') }}
# with:
# package-version-ids: ${{ needs.build-toolkit.outputs.version }}
# owner: ${{ github.owner }}
# package-name: elemental-toolkit/elemental-cli
# package-type: container
10 changes: 8 additions & 2 deletions .github/workflows/build_and_test_x86.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,17 @@ jobs:
else
echo "tests=['test-active']" >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.merge_commit_sha }}"
- id: image
env:
FLAVOR: ${{ inputs.flavor }}
run: |
export VERSION=$(git describe --tags --candidates=50)
git fetch --prune --unshallow
export TAG=$(git describe --tags --candidates=50 --abbrev=0)
export COMMIT=$(git rev-parse --short HEAD)
export VERSION=${TAG}-g${COMMIT}
echo "upgrade=ghcr.io/rancher/elemental-toolkit/elemental-${FLAVOR}:${VERSION}" >> $GITHUB_OUTPUT
echo "toolkit=ghcr.io/rancher/elemental-toolkit/elemental-cli:${VERSION}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -186,7 +192,7 @@ jobs:
- if: ${{ matrix.test == 'test-upgrade' }}
name: Download specific disk
run: |
wget https://github.com/rancher/elemental-toolkit/releases/download/v1.1.4/elemental-${{ inputs.flavor }}-v1.1.4.${{ env.ARCH }}.qcow2 -O /tmp/elemental-${{ inputs.flavor }}.${{ env.ARCH }}.qcow2
wget -q --tries=3 https://github.com/rancher/elemental-toolkit/releases/download/v1.1.4/elemental-${{ inputs.flavor }}-v1.1.4.${{ env.ARCH }}.qcow2 -O /tmp/elemental-${{ inputs.flavor }}.${{ env.ARCH }}.qcow2
- if: ${{ matrix.test != 'test-upgrade' }}
name: Cached Disk
id: cache-disk
Expand Down

0 comments on commit 80f862f

Please sign in to comment.