Skip to content

Commit

Permalink
Prepare source archive releases
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbarsky committed Sep 16, 2023
1 parent 6b3be29 commit f1fc6c6
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .bcr/source.template.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"integrity": "",
"strip_prefix": "aws-in-a-box-{VERSION}",
"url": "https://github.com/dzbarsky/aws-in-a-box/archive/refs/tags/{TAG}.tar.gz"
"url": "https://github.com/dzbarsky/aws-in-a-box/releases/download/{VERSION}/aws-in-a-box-{TAG}.tar.gz"
}
30 changes: 0 additions & 30 deletions .github/workflows/build.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/build_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set -eux

for GOOS in "windows" "linux" "darwin"; do
for GOARCH in "amd64" "arm64"; do
CGO_ENABLED=0 go build -ldflags "-w" -trimpath -o "./aws-in-a-box-$GOOS-$GOARCH"
done
done

# Set by GH actions, see
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
TAG=${GITHUB_REF_NAME}
# The prefix is chosen to match what GitHub generates for source archives
PREFIX="aws-in-a-box-${TAG:1}"
ARCHIVE="aws-in-a-box-$TAG.tar.gz"
git archive --format=tar --prefix="${PREFIX}/" "${TAG}" | gzip > "$ARCHIVE"
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: release

on:
push:
tags:
- "v*.*.*"

jobs:
release:
strategy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"

- name: Build
run: .github/workflows/build_release.sh

- name: Release
uses: softprops/action-gh-release@v1
with:
files: ./aws-in-a-box-*
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(
name = "aws-in-a-box",
version = "0.0.37",
version = "0.0.38",
compatibility_level = 1,
)

Expand Down

0 comments on commit f1fc6c6

Please sign in to comment.