Skip to content

Commit

Permalink
Run release builds on all branches
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffijoe committed Sep 6, 2024
1 parent 87b2232 commit a430a2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:
on:
push:
branches:
- main
- "**"
tags:
- 'v*'

Expand All @@ -21,6 +21,8 @@ jobs:
outputs:
tag: ${{ steps.compute.outputs.tag }}
docker_tags: ${{ steps.compute.outputs.docker_tags }}
push: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' }}

steps:
- name: "Compute Release Tag"
id: compute
Expand Down Expand Up @@ -79,7 +81,7 @@ jobs:
context: .
file: ./Dockerfile
platforms: linux/386,linux/amd64,linux/arm64
push: true
push: ${{ fromJSON(needs.tag.outputs.push) }}
tags: ${{ needs.tag.outputs.docker_tags }}

binary:
Expand Down Expand Up @@ -200,13 +202,15 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v4
if: ${{ fromJSON(needs.tag.outputs.push) }}
with:
name: ${{ matrix.asset_name }}
path: ./target/${{ matrix.target }}/release/${{ matrix.artifact_name }}

- name: Archive Release
shell: bash
id: archive
if: ${{ fromJSON(needs.tag.outputs.push) }}
run: |
# Compress to zip or tar.gz based on the OS.
DEST="";
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM rust:1.81 as build
FROM --platform=$BUILDPLATFORM rust:1.81 AS build

# Install Protocol Buffers.
RUN apt-get update && apt-get install -y protobuf-compiler clang musl-tools musl-dev
Expand Down Expand Up @@ -106,7 +106,7 @@ RUN <<EOF
EOF

# Our final base image.
FROM --platform=$TARGETPLATFORM scratch as deltio
FROM scratch AS deltio

# Copy the build artifact from the build stage
COPY --from=build /deltio/target/release/deltio .
Expand Down

0 comments on commit a430a2e

Please sign in to comment.