diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b71e5e2..a776f6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,38 +31,38 @@ jobs: - name: Setup Repo uses: actions/checkout@v3 - - name: Check ENVs - run: printenv + - name: Install dependencies + run: go mod tidy - # - name: Run Unit Tests - # run: go test -v ./... + - name: Run Unit Tests + run: go test -v ./... - # - name: Build temporary cli - # run: go build -o ./selfupdate ./cmd/selfupdate/main.go + - name: Build temporary cli + run: go build -o ./selfupdate ./cmd/selfupdate/main.go - # - name: Create a Release - # run: | - # ./selfupdate github release \ - # --owner blockthrough \ - # --repo selfupdate.go \ - # --version ${{ SELF_UPDATE_VERSION }} \ - # --title ${{ SELF_UPDATE_VERSION }} \ - # --token ${{ SELF_UPDATE_GH_TOKEN }} + - name: Create a Release + run: | + ./selfupdate github release \ + --owner blockthrough \ + --repo selfupdate.go \ + --version $SELF_UPDATE_VERSION \ + --title $SELF_UPDATE_VERSION \ + --token $SELF_UPDATE_GH_TOKEN - # - name: Build and Sign - # run: | - # GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} \ - # go build \ - # -ldflags "-X main.Version=${{ SELF_UPDATE_VERSION }} -X main.PublicKey=${{ SELF_UPDATE_PUBLIC_KEY }}" \ - # -o ./selfupdate-${{ matrix.os }}-${{ matrix.arch }} \ - # ./cmd/selfupdate/main.go + - name: Build and Sign + run: | + GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} \ + go build \ + -ldflags "-X main.Version=$SELF_UPDATE_VERSION -X main.PublicKey=$SELF_UPDATE_PUBLIC_KEY" \ + -o ./selfupdate-${{ matrix.os }}-${{ matrix.arch }} \ + ./cmd/selfupdate/main.go - # - name: Upload New Release - # run: | - # ./selfupdate github upload \ - # --owner blockthrough \ - # --repo selfupdate.go \ - # --filename selfupdate-${{ matrix.os }}-${{ matrix.arch }}.sign \ - # --version ${{ SELF_UPDATE_VERSION }} \ - # --token ${{ SELF_UPDATE_GH_TOKEN }} \ - # --key ${{ SELF_UPDATE_PRIVATE_KEY }} < ./selfupdate-${{ matrix.os }}-${{ matrix.arch }} + - name: Upload New Release + run: | + ./selfupdate github upload \ + --owner blockthrough \ + --repo selfupdate.go \ + --filename selfupdate-${{ matrix.os }}-${{ matrix.arch }}.sign \ + --version $SELF_UPDATE_VERSION \ + --token $SELF_UPDATE_GH_TOKEN \ + --key $SELF_UPDATE_PRIVATE_KEY < ./selfupdate-${{ matrix.os }}-${{ matrix.arch }}