-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f705123
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Build and Publish Jsonnet | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Jsonnet Version" | ||
required: true | ||
default: "v0.20.0" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- linux/amd64 | ||
- linux/arm64 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build image | ||
run: | | ||
docker buildx build \ | ||
--load \ | ||
--platform ${{ matrix.platform }} \ | ||
--build-arg JSONNET_REPO_TAG=${{ github.event.inputs.version }} \ | ||
--tag jsonnet:local \ | ||
. | ||
- name: Create container | ||
run: | | ||
docker create --name temp_container jsonnet:local | ||
- name: Setup assets name | ||
id: assets | ||
run: | | ||
version='${{ github.event.inputs.version }}' | ||
platform=$(echo '${{ matrix.platform }}' | tr '/' '-') | ||
echo "archive_name=jsonnet-${version}-${platform}.tar.gz" >> $GITHUB_OUTPUT | ||
- name: Copy jsonnet binaries from Docker container | ||
id: binaries | ||
run: | | ||
docker cp temp_container:/workdir/jsonnet ./jsonnet | ||
docker cp temp_container:/workdir/jsonnetfmt ./jsonnetfmt | ||
tar -czvf ${{ steps.assets.outputs.archive_name }} jsonnet jsonnetfmt | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: ${{ github.event.inputs.version }} | ||
tag_name: ${{ github.event.inputs.version }} | ||
files: ${{ steps.assets.outputs.archive_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM alpine:3.10.3 AS jsonnet_builder | ||
WORKDIR /workdir | ||
ARG JSONNET_REPO_TAG='v0.20.0' | ||
RUN apk -U add build-base git \ | ||
&& git clone --depth 1 --branch "${JSONNET_REPO_TAG}" https://github.com/google/jsonnet . \ | ||
&& export LDFLAGS=-static \ | ||
&& make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# jsonnet | ||
Static compiled jsonnet binaries |