readme #16
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
name: Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20" | |
check-latest: true | |
- name: Cross Compile | |
run: | | |
mkdir bin | |
GOOS=linux GOARCH=amd64 go build -o ./bin/geo-linux-amd64 ./cmd/geo | |
GOOS=linux GOARCH=arm64 go build -o ./bin/geo-linux-arm64 ./cmd/geo | |
GOOS=linux GOARCH=arm GOARM=7 go build -o ./bin/geo-linux-armv7 ./cmd/geo | |
GOOS=darwin GOARCH=amd64 go build -o ./bin/geo-macos-amd64 ./cmd/geo | |
GOOS=darwin GOARCH=arm64 go build -o ./bin/geo-macos-arm64 ./cmd/geo | |
GOOS=windows GOARCH=amd64 go build -o ./bin/geo-windows-amd64.exe ./cmd/geo | |
GOOS=windows GOARCH=arm64 go build -o ./bin/geo-windows-arm64.exe ./cmd/geo | |
- name: Delete current release assets | |
uses: 8Mi-Tech/delete-release-assets-action@main | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: Prerelease-${{ github.ref_name }} | |
deleteOnlyFromDrafts: false | |
- name: Tag Repo | |
uses: richardsimko/[email protected] | |
with: | |
tag_name: Prerelease-${{ github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set Env | |
run: | | |
echo "BUILDTIME=$(TZ=Asia/Shanghai date)" >> $GITHUB_ENV | |
shell: bash | |
- name: Upload Prerelease | |
uses: softprops/action-gh-release@v1 | |
if: ${{ success() }} | |
with: | |
tag_name: Prerelease-${{ github.ref_name }} | |
files: | | |
bin/* | |
prerelease: true | |
generate_release_notes: true |