go update #22
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
# https://docs.github.com/en/actions/learn-github-actions/contexts | |
name: release | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build-push-ubuntu-24-04: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: version | |
run: | | |
BUILD_OS=ubuntu-24.04 | |
echo "BUILD_OS:$BUILD_OS" | |
echo "BUILD_OS=$BUILD_OS" >> $GITHUB_ENV | |
VERSION=$( date '+%y.%m%d.%H%M' )-$BUILD_OS | |
echo "VERSION:$VERSION" | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v4 | |
with: | |
# https://go.dev/dl/ | |
go-version: '^1.23.4' | |
- name: go build | |
run: GOOS=linux GOARCH=amd64 go build -o ${{ github.event.repository.name }}.linux.amd64 -trimpath -ldflags ' -X main.Version='$VERSION | |
- name: gzip | |
run: gzip -k ${{ github.event.repository.name }}.linux.amd64 | |
- name: list files | |
run: ls -l -a | |
- name: release notes | |
run: | | |
{ | |
echo "curl -sSL https://github.com/shoce/${{ github.event.repository.name }}/releases/download/$VERSION/${{ github.event.repository.name }}.linux.amd64.gz | gunzip | put /bin/${{ github.event.repository.name }}-$BUILD_OS 755" | |
echo "curl -sSL https://github.com/shoce/${{ github.event.repository.name }}/releases/download/$VERSION/${{ github.event.repository.name }}.linux.amd64.gz | gunzip | put /bin/${{ github.event.repository.name }} 755" | |
echo | |
echo /etc/os-release: | |
cat /etc/os-release | |
echo | |
echo go version: | |
go version | |
} >release.notes..text | |
- name: gh release | |
shell: bash | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: gh release create $VERSION ${{ github.event.repository.name }}.linux.amd64.gz --notes-file release.notes..text | |
build-push-alpine-3-20: | |
runs-on: ubuntu-latest | |
steps: | |
- name: version | |
run: | | |
BUILD_OS=alpine-3.20 | |
echo "BUILD_OS:$BUILD_OS" | |
echo "BUILD_OS=$BUILD_OS" >> $GITHUB_ENV | |
VERSION=$( date '+%y.%m%d.%H%M' )-$BUILD_OS | |
echo "VERSION:$VERSION" | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
# https://github.com/jirutka/setup-alpine | |
- uses: jirutka/setup-alpine@v1 | |
with: | |
branch: v3.20 | |
arch: x86_64 | |
packages: > | |
go | |
- name: go build | |
shell: alpine.sh {0} | |
run: GOOS=linux GOARCH=amd64 go build -o ${{ github.event.repository.name }}.linux.amd64 -trimpath -ldflags ' -X main.Version='$VERSION | |
- name: gzip | |
shell: alpine.sh {0} | |
run: gzip -k ${{ github.event.repository.name }}.linux.amd64 | |
- name: list files | |
shell: alpine.sh {0} | |
run: ls -l -a | |
- name: release notes | |
shell: alpine.sh {0} | |
run: | | |
{ | |
echo "curl -sSL https://github.com/shoce/${{ github.event.repository.name }}/releases/download/$VERSION/${{ github.event.repository.name }}.linux.amd64.gz | gunzip | put /bin/${{ github.event.repository.name }}-$BUILD_OS 755" | |
echo "curl -sSL https://github.com/shoce/${{ github.event.repository.name }}/releases/download/$VERSION/${{ github.event.repository.name }}.linux.amd64.gz | gunzip | put /bin/${{ github.event.repository.name }} 755" | |
echo | |
echo /etc/alpine-release: | |
cat /etc/alpine-release | |
echo | |
echo go version: | |
go version | |
} >release.notes..text | |
- name: gh release | |
shell: bash | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: gh release create $VERSION ${{ github.event.repository.name }}.linux.amd64.gz --notes-file release.notes..text | |