From bb65d66264e0d851dff1f8a9460ec999abcb45f3 Mon Sep 17 00:00:00 2001 From: Shim Shtein Date: Mon, 4 Apr 2022 13:11:04 +0300 Subject: [PATCH] Add release workflow --- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..928d8e8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Generate release-artifacts + +# on events +on: + push: + tags: + - 'v*' + +# workflow tasks +jobs: + generate: + name: Generate cross-platform builds + runs-on: ubuntu-latest + steps: + - uses: olegtarasov/get-tag@v2.1 + id: tagName + with: + tagRegex: "v(.*)" # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined. + tagRegexGroup: 1 # Optional. Default is 1. + - name: Checkout the repository + uses: actions/checkout@v2 + - name: Generate build files + uses: thatisuday/go-cross-build@v1.1.0 + with: + platforms: 'linux/amd64' + package: 'src' + name: 'yggdrasil-worker-forwarder-${{ steps.tagName.outputs.tag }}' + compress: 'true' + dest: 'dist' + - name: Generate distribution tarball + run: | + make distribution-tarball + sudo mv *.tar.gz dist/ + env: + VERSION: '${{ steps.tagName.outputs.tag }}' + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: dist/* + tag: ${{ github.ref }} + overwrite: true + file_glob: true