Skip to content

Commit

Permalink
fix release image build and push (#13)
Browse files Browse the repository at this point in the history
Signed-off-by: Tiago Bueno <49003339+tlbueno@users.noreply.github.com>
  • Loading branch information
tlbueno committed Nov 1, 2024
1 parent 76e477f commit b506f07
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Push Container Image
name: Release

on:
push:
Expand Down Expand Up @@ -31,7 +31,7 @@ jobs:
uses: redhat-actions/buildah-build@v2
with:
image: toolbox
tags: ${{ env.VERSION }} ${{ github.sha }} latest
tags: ${{ env.VERSION }} latest
containerfiles: |
./Containerfile
oci: true
Expand All @@ -47,3 +47,20 @@ jobs:
- name: Echo outputs
run: |
echo "${{ toJSON(steps.push.outputs) }}"
- name: Create release
run: |
set -x
RELEASE_ID=$(curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ env.VERSION }}" | jq -r '.id')
if [ -n "$RELEASE_ID" ]; then
curl -L -X DELETE -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/${{ github.repository }}/releases/${RELEASE_ID}"
fi
curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/${{ github.repository }}/releases" \
-d "$(jq -c -n --arg tag_name "${{ env.VERSION }}" '{"name":$tag_name,"tag_name":$tag_name,"generate_release_notes":true,"target_commitish":$tag_name}')"
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ARG toolboxUserGroup=toolbox
ARG toolboxUserHome=/home/toolbox

LABEL org.opencontainers.image.source="https://github.com/tlbueno/toolbox"
LABEL org.opencontainers.image.description="An alpine linux container image with general tools to be used as a toolbox"

USER root

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# toolbox

An alpine linux container image with general tools to be used as a toolbox.
An alpine linux container image with general tools to be used as a toolbox.
Check the [Containerfile](./Containerfile) for the details about installed tools in the [source repo](https://github.com/tlbueno/toolbox)

### How to use

Pull the image from [quay.io](https://quay.io/repository/tlbueno/toolbox)
Pull the image from [ghcr.io](https://github.com/tlbueno/toolbox/pkgs/container/toolbox)

```sh
podman pull quay.io/tlbueno/toolbox
podman pull ghcr.io/tlbueno/toolbox:latest
```

### How to build
Expand Down

0 comments on commit b506f07

Please sign in to comment.