forked from containers/skopeo
-
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
Ubuntu_office
committed
Nov 2, 2021
1 parent
130f32f
commit 3dd318d
Showing
1 changed file
with
42 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,42 @@ | ||
--- | ||
name: Build static binary | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
env: | ||
BUILDER_IMAGE: ghcr.io/k8sli/nixos-nix:v2.3.12 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- arch: amd64 | ||
- arch: arm64 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Build skopeo binary file | ||
run: | | ||
DIGEST=$(skopeo --insecure-policy --override-arch ${{ matrix.arch }} inspect docker://${BUILDER_IMAGE} | jq -r '.Digest') | ||
docker run --rm -t -v $PWD:/build ${BUILDER_IMAGE}@${DIGEST} \ | ||
sh -c "cd /build && nix build -f nix && cp ./result/bin/skopeo skopeo-linux-${{ matrix.arch }}" | ||
sha256sum skopeo-linux-${{ matrix.arch }} > skopeo-linux-${{ matrix.arch }}.sha256sum.txt | ||
- name: Release and upload binary file | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: | | ||
skopeo-linux-${{ matrix.arch }} | ||
skopeo-linux-${{ matrix.arch }}.sha256sum.txt |