diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..a57e4b9 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,41 @@ +name: Release + +on: + push: + branches: ["master"] + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Check out + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Determine version + id: version + uses: silphid/actions/get-version@master + + - name: Setup go environment + uses: actions/setup-go@v3.3.1 + with: + go-version-file: go.mod + cache: true + cache-dependency-path: go.sum + + - name: Tag commit + uses: silphid/actions/tag-commit@v1 + with: + tag: ${{ steps.version.outputs.git-tag }} + + - name: Release + uses: goreleaser/goreleaser-action@v4 + with: + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index a9e4f0d..6fd25cc 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -6,12 +6,11 @@ builds: goos: - linux - darwin + ldflags: + - -X "main.version=v{{ .Version }}" archives: - format: tar.gz wrap_in_directory: false - replacements: - 386: i386 - amd64: x86_64 checksum: name_template: "checksums.txt" snapshot: @@ -25,7 +24,7 @@ changelog: brews: - tap: owner: silphid - name: homebrew-yey + name: homebrew-tap homepage: "https://github.com/silphid/yey" description: "An interactive, human-friendly docker launcher for dev and devops" license: "MIT" diff --git a/README.md b/README.md index da84fa8..94524da 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Yey was designed to address all those challenges and more by abstracting all con - MacOS ```bash - $ brew tap silphid/yey + $ brew tap silphid/tap $ brew install yey ``` diff --git a/dev/release b/dev/release deleted file mode 100755 index 2a4b0d7..0000000 --- a/dev/release +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -goreleaser release --rm-dist \ No newline at end of file