diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 205120ab..2abcff98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Check out uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..63ede82b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Release +on: + push: + tags: + - v* +jobs: + goreleaser: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 560986be..7f6fde26 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,6 +8,10 @@ builds: - env: - CGO_ENABLED=0 main: ./cmd/dagger + binary: dagger + ldflags: + - -s -w + - -X dagger.io/go/cmd/dagger/cmd.version={{.Version}} goos: - linux - windows