From f75206bce68be163536a1128eb3f944f6074c716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Gr=C3=A9goire?= Date: Sun, 30 Jan 2022 22:37:48 -0500 Subject: [PATCH] Automatically build and publish releases Adds a GitHub action to automatically build and publish releases when a tag matching "v*" is pushed. Makes use of https://github.com/marvinpinto/action-automatic-releases --- .github/workflows/releases.yml | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/releases.yml diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml new file mode 100644 index 0000000..0f3fc98 --- /dev/null +++ b/.github/workflows/releases.yml @@ -0,0 +1,37 @@ +--- +name: releases + +on: + push: + tags: + - "v*" + +jobs: + gh_tagged_release: + runs-on: "ubuntu-latest" + steps: + - name: "Checkout source code" + uses: "actions/checkout@v2.3.4" + with: + lfs: true + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: Build for Linux-amd64 + run: GOOS=linux GOARCH=amd64 go build -x -v -mod=vendor -ldflags "-X main.version=$(echo ${GITHUB_REF} | awk -F/ '{print substr($3,2,10);}') -w -s" -o tty-share_linux-amd64 + - name: Build for Linux-i386 + run: GOOS=linux GOARCH=386 go build -x -v -mod=vendor -ldflags "-X main.version=$(echo ${GITHUB_REF} | awk -F/ '{print substr($3,2,10);}') -w -s" -o tty-share_linux-i386 + - name: Build for Darwin-amd64 + run: GOOS=darwin GOARCH=amd64 go build -x -v -mod=vendor -ldflags "-X main.version=$(echo ${GITHUB_REF} | awk -F/ '{print substr($3,2,10);}') -w -s" -o tty-share_darwin-amd64 + + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + tty-share_* + id: "automatic_releases"