diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index fd6ed202..a35fcd3e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -2,7 +2,6 @@ name: Go on: push: - branches: [ master ] pull_request: branches: [ master ] @@ -13,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.4 + - name: Set up Go 1.14 uses: actions/setup-go@v2 with: go-version: ^1.14 @@ -27,3 +26,24 @@ jobs: - name: Test run: go test -v ./... + + release: + name: Release + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + needs: + - build + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup Go + uses: actions/setup-go@v2 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..28fc70ba --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,5 @@ +builds: + - goos: + - linux + - windows + - darwin diff --git a/README.md b/README.md index 7280ae40..5e6f58a9 100644 --- a/README.md +++ b/README.md @@ -36,23 +36,9 @@ The classic way to install go get -u github.com/cosmtrek/air ``` -### macOS +### macOS, Linux, Windows -```bash -curl -fLo air https://git.io/darwin_air -``` - -### Linux - -```bash -curl -fLo air https://git.io/linux_air -``` - -### Windows - -```bash -curl -fLo air.exe https://git.io/windows_air -``` +The binary is published on the [release page](https://github.com/cosmtrek/air/releases). P.S. Great thanks mattn's [PR](https://github.com/cosmtrek/air/pull/1) for supporting Windows platform. diff --git a/bin/darwin/air b/bin/darwin/air deleted file mode 100755 index 77b69f67..00000000 Binary files a/bin/darwin/air and /dev/null differ diff --git a/bin/linux/air b/bin/linux/air deleted file mode 100755 index 697a622e..00000000 Binary files a/bin/linux/air and /dev/null differ diff --git a/bin/windows/air.exe b/bin/windows/air.exe deleted file mode 100755 index a76c68a6..00000000 Binary files a/bin/windows/air.exe and /dev/null differ