Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker build to release workflow #186

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/tests/it/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
spire-server:
image: ghcr.io/spiffe/spire-server:1.7.0
Expand Down Expand Up @@ -66,4 +65,4 @@ services:
volumes:
- ./var/run/api.sock:/var/run/api.sock
- ./client/helper.conf:/opt/spire/conf/client/helper.conf
command: ["su", "client", "-c", "/opt/helper/spiffe-helper -config /opt/spire/conf/client/helper.conf"]
command: ["su", "client", "-c", "/opt/helper/spiffe-helper -config /opt/spire/conf/client/helper.conf"]
25 changes: 22 additions & 3 deletions .github/workflows/release_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
build:
name: build (linux)
runs-on: ubuntu-22.04
needs: integration-tests

steps:
- name: Checkout
Expand All @@ -53,15 +54,23 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build artifact
run: make build
- name: Build docker artifact
run: make docker-build
- name: Compress artifact
run: tar -czvf spiffe-helper-${{ github.ref_name }}.tar.gz spiffe-helper
- name: Archive artifact
uses: actions/upload-artifact@v4
with:
name: spiffe-helper
path: spiffe-helper-${{ github.ref_name }}.tar.gz
path: |
spiffe-helper-${{ github.ref_name }}.tar.gz
spiffe-helper-image.tar

release:
runs-on: ubuntu-22.04
Expand All @@ -77,9 +86,19 @@ jobs:
uses: actions/download-artifact@v4
with:
name: spiffe-helper
path: ./artifact/
path: .
- name: Log in to GHCR
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install regctl
uses: regclient/actions/regctl-installer@main
- name: Push docker image
run: ./.github/workflows/scripts/push-images.sh ${{ github.ref_name }}
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Create the release using the version number as the title
run: gh release create "${GITHUB_REF#refs/tags/}" ./artifact/spiffe-helper-${{ github.ref_name }}.tar.gz --title "${GITHUB_REF#refs/tags/}"
run: gh release create "${GITHUB_REF#refs/tags/}" ./spiffe-helper-${{ github.ref_name }}.tar.gz --title "${GITHUB_REF#refs/tags/}"
Loading