Skip to content

Commit

Permalink
Some fixes for subctl-devel release job
Browse files Browse the repository at this point in the history
* Release should be also deleted or it leaves a "draft release".
* Tag name should be `subctl-${BRANCH}` e.g. `subctl-devel`.
* Added notes to the release created in GH to match what we had.
* Seems `gh` CLI is already available, no need to install it.

Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>
(cherry picked from commit f1aaf10)
  • Loading branch information
mkolesnik authored and tpantelis committed Jun 29, 2021
1 parent 51ef445 commit 91216fa
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/release_subctl_devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,19 @@ jobs:

- name: Generate subctl version
run: |
echo "SUBCTL_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "RELEASE=release-${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "RELEASE=subctl-${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Generate the subctl release artifacts
run: make build-cross VERSION=${{ env.SUBCTL_TAG }}
run: make build-cross VERSION=${{ env.BRANCH }}

- name: Install GH CLI
run: |
curl -sLo /tmp/gh.deb https://github.com/cli/cli/releases/download/v1.11.0/gh_1.11.0_linux_amd64.deb
sudo apt install /tmp/gh.deb
- name: Delete old release
run: git push -d origin ${{ env.RELEASE }} || true

- name: Create the release with the updated artifacts
- name: Recreate the release with the updated artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release delete ${{ env.RELEASE }} -y || true
git push -d origin ${{ env.RELEASE }} || true
gh release create ${{ env.RELEASE }} dist/*.tar.xz --prerelease \
--title "Cutting Edge: ${{ env.SUBCTL_TAG }}" \
--title "Cutting Edge: ${{ env.BRANCH }}" \
--notes "Cutting edge binaries of \`subctl\` for '${{ env.BRANCH }}' branch, always updated to the latest merged code." \
--target ${GITHUB_SHA}

0 comments on commit 91216fa

Please sign in to comment.