Skip to content

Commit

Permalink
Merge pull request #4 from realk1ko/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
realk1ko authored Aug 21, 2023
2 parents 7fbe764 + 9ca8476 commit a0748d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
shell: bash
run: |
set -euo pipefail
dnf info -q cockpit-ws | sed -e "/^Version/!d" -e "s/Version *: *//g" | tr -d "\n" > /workspace/COCKPIT_VERSION || :
dnf list -q cockpit-ws | tail -n +2 | tr -s " " | cut -d " " -f2 | tr -d "\n" > /workspace/COCKPIT_VERSION || :
- name: Get Cockpit version
id: get-cockpit-version
Expand All @@ -60,18 +60,20 @@ jobs:
set -euo pipefail
cockpit_version=$(cat ${{ github.workspace }}/COCKPIT_VERSION)
cockpit_version_tag=$(echo -n ${cockpit_version} | tr ":" "-")
skip_workflow=0
rm -f COCKPIT_VERSION
bearer_token=$(echo "${{ secrets.token }}" | base64)
if [[ "${{ inputs.release }}" = "true" ]] && (curl -If -H "Authorization: Bearer ${bearer_token}" "https://ghcr.io/v2/${{ secrets.username }}/${{ inputs.image_name }}/manifests/${cockpit_version}" || false); then
if [[ "${{ inputs.release }}" = "true" ]] && (curl -If -H "Authorization: Bearer ${bearer_token}" "https://ghcr.io/v2/${{ secrets.username }}/${{ inputs.image_name }}/manifests/${cockpit_version_tag}" || false); then
echo "Version ${cockpit_version} has already been released."
skip_workflow=1
fi
echo "cockpit_version=${cockpit_version}" >> $GITHUB_OUTPUT
echo "cockpit_version_tag=${cockpit_version_tag}" >> $GITHUB_OUTPUT
echo "skip_workflow=${skip_workflow}" >> $GITHUB_OUTPUT
- name: Prepare tags
Expand All @@ -83,7 +85,7 @@ jobs:
ghcr.io/${{ secrets.username }}/${{ inputs.image_name }}
tags: |
type=raw,value=latest,enable=${{ inputs.release }}
type=raw,value=${{ steps.get-cockpit-version.outputs.cockpit_version }},enable=${{ inputs.release }}
type=raw,value=${{ steps.get-cockpit-version.outputs.cockpit_version_tag }},enable=${{ inputs.release }}
type=raw,value=edge,enable=${{ !inputs.release }}
type=sha,enable=${{ !inputs.release }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Cockpit Web Service (`cockpit-ws`).
The following tags are published to the GitHub Container Registry:

- `:latest`: This is the tag you should be using. is updated within a day of a new release of the Cockpit packages for
Fedora automatically. Additionally, each release is tagged with the installed Cockpit version (e. g. `:280`).
Fedora automatically. Additionally, each release is tagged with the installed Cockpit version (e. g. `:298-1.fc38`).
- `:edge`: Latest build of the image on the latest commit on the `dev` branch. Each image tagged with this is also
tagged with the SHA commit reference it was built on (e. g. `:sha-bb8c5c4`).

Expand Down

0 comments on commit a0748d2

Please sign in to comment.