Skip to content

v0.1.15

v0.1.15 #19

name: Publish scaffolder
on:
release:
types: [published]
defaults:
run:
shell: bash
jobs:
deploy:
runs-on: [ubuntu-22.04]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Build
run: |
mkdir -p bin
for os in linux darwin; do
for arch in amd64 arm64; do
file=bin/scaffold-$os-$arch
echo "Building $file ..."
GOOS=$os GOARCH=$arch go build -o $file -ldflags "-X main.version=${{ github.event.release.tag_name }}" ./scaffold
done
done
- name: Upload
run: |
for os in linux darwin; do
for arch in amd64 arm64; do
upload_url="${{ github.event.release.upload_url }}"
upload_url=${upload_url%%\{*\}}
file=bin/scaffold-$os-$arch
echo "Uploading $file to $upload_url ..."
curl -sSf \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: $(file -b --mime-type $file)" \
--data-binary @$file \
"$upload_url?name=$(basename $file)"
done
done