diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c7add797..295a3074 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,8 +44,47 @@ jobs: - uses: action/upload-artifact@v3 with: - name: zrok-linux - path: dist/zrok* + name: release-builds + path: ./dist/*.gz + + build-darwin: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - run: git fetch --force --tags + + - uses: actions/setup-go@v3 + with: + go-version: '>=1.19.3' + cache: true + + - uses: actions/setup-node@v3 + with: + node-version: 16.x + + - run: npm install + working-directory: ui + + - run: npm run build + working-directory: ui + env: + CI: "" + + - uses: goreleaser/goreleaser-action@v2 + with: + distribution: goreleaser + version: latest + args: release --skip-publish --config .goreleaser-darwin.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: action/upload-artifact@v3 + with: + name: release-builds + path: ./dist/*.gz build-windows: runs-on: ubuntu-latest @@ -85,35 +124,26 @@ jobs: - uses: action/upload-artifact@v3 with: - name: zrok-windows - path: dist/zrok* + name: release-builds + path: ./dist/*.gz publish-release: - needs: [build-linux, build-windows] + needs: [build-linux, build-darwin, build-windows] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - run: | - mkdir -p ./zrok-build/linux - mkdir -p ./zrok-build/windows + mkdir -p ./automated-release-build - uses: actions/download-artifact@v3 with: - name: zrok-linux - path: ./zrok-build/linux - - - uses: actions/download-artifact@v3 - with: - name: zrok-windows - path: ./zrok-build/windows + path: ./automated-release-build - run: | - cd ./zrok-build - cat ./linux/zrok*checksums.txt >> checksums.txt - cat ./windows/zrok*checksums.txt >> checksums.txt - rm ./linux/zrok*checksums.txt - rm ./windows/zrok*checksums.txt + mv ./automated-release-build/release-builds/* ./automated-release-build/ + rm -rf ./automated-release-build/release-builds + shasum ./automated-release-build/* > ./automated-release-build/checksums.txt - uses: goreleaser/goreleaser-action@v3 with: diff --git a/.gitignore b/.gitignore index 5aa174b1..115a11f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .$* .idea *.db +automated-release-build diff --git a/.goreleaser-darwin.yml b/.goreleaser-darwin.yml new file mode 100644 index 00000000..cd11157c --- /dev/null +++ b/.goreleaser-darwin.yml @@ -0,0 +1,10 @@ +builds: + - main: ./cmd/zrok + binary: zrok + env: + - CGO_ENABLED=1 + goos: + - darwin + goarch: + - amd64 + - arm64 \ No newline at end of file diff --git a/.goreleaser-linux.yml b/.goreleaser-linux.yml index 77cd695b..5838b2d0 100644 --- a/.goreleaser-linux.yml +++ b/.goreleaser-linux.yml @@ -1,5 +1,6 @@ builds: - main: ./cmd/zrok + binary: zrok ldflags: "-s -w -X github.com/openziti-test-kitchen/zrok/build.Version={{.Tag}} -X github.com/openziti-test-kitchen/zrok/build.Hash={{.ShortCommit}}" env: - CGO_ENABLED=1 diff --git a/.goreleaser-release.yml b/.goreleaser-release.yml index ed7b167e..9effbc27 100644 --- a/.goreleaser-release.yml +++ b/.goreleaser-release.yml @@ -4,5 +4,4 @@ release: draft: true mode: append extra_files: - - glob: ./zrok-build/**/* - - glob: ./zrok-build/checksums.txt \ No newline at end of file + - glob: ./automated-release-build/* \ No newline at end of file diff --git a/.goreleaser-windows.yml b/.goreleaser-windows.yml index fb4b49ca..9601d1dc 100644 --- a/.goreleaser-windows.yml +++ b/.goreleaser-windows.yml @@ -1,5 +1,6 @@ builds: - main: ./cmd/zrok + binary: zrok ldflags: "-s -w -X github.com/openziti-test-kitchen/zrok/build.Version={{.Tag}} -X github.com/openziti-test-kitchen/zrok/build.Hash={{.ShortCommit}}" env: - CGO_ENABLED=1