diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..6bb05cc --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,39 @@ +name: Release latest tag + +on: + create: + tags: + - v* + pull_request: + branches: + - "main" + +permissions: + contents: write + +jobs: + release: + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # To use `git describe --tags` + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: "1.22" + + - name: Setup Task + uses: arduino/setup-task@v2 + + - name: Build and package + run: task build-all + + - name: Release + uses: softprops/action-gh-release@v2 + with: + files: | + result/*.tar.gz \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index a01e3fc..6f6f8c5 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,7 +1,8 @@ version: '3' vars: - VERSION: "v0.2.0" + VERSION: + sh: git describe --tags | sed -r 's/-.+//' tasks: prepare: