From 1ece20538683d417c07aad95d068d1d913c42cc1 Mon Sep 17 00:00:00 2001 From: Jerry Jacobs Date: Wed, 31 Jul 2024 15:57:34 +0200 Subject: [PATCH] Bye bye goreleaser (for now) --- .github/workflows/build.yml | 70 ----------------------- .github/workflows/goreleaser.yaml.snippet | 69 ++++++++++++++++++++++ 2 files changed, 69 insertions(+), 70 deletions(-) create mode 100644 .github/workflows/goreleaser.yaml.snippet diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc1376d..2d15836 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,73 +55,3 @@ jobs: name: dist-release path: | dist - - goreleaser: - name: Build releases with goreleaser - environment: prod - runs-on: ubuntu-latest - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - cache: true - check-latest: true - - - name: Set up MinGW - uses: egor-tensin/setup-mingw@v2 - with: - platform: x64 - - - name: Use config_release.go from action secrets - uses: mobiledevops/secret-to-file-action@v1 # TODO native in Makefile, can be unsafe... - with: - base64-encoded-secret: ${{ secrets.CONFIG_RELEASE_GO_FILE }} - filename: "config_release.go" - - - name: Use resources/ssh_private_key.base64.rot13 from action secrets - uses: mobiledevops/secret-to-file-action@v1 # TODO native in Makefile, can be unsafe... - with: - base64-encoded-secret: ${{ secrets.RESOURCES_SSH_PRIVATE_KEY_BASE64_ROT13 }} - filename: "ssh_private_key.base64.rot13" - working-directory: "./resources" - - - name: Install upx - run: sudo apt install upx - - - name: Install garble - run: make install-deps - - - name: Run GoReleaser to build releases - uses: goreleaser/goreleaser-action@v6 - with: - # either 'goreleaser' (default) or 'goreleaser-pro' - distribution: goreleaser - # 'latest', 'nightly', or a semver - version: '~> v2' - args: release --clean --snapshot --id win-release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # NOTE: Some virus and malware scanners detect mangled UPX headers and mark it as suspisious - #- name: Obfuscate UPX packed executable - # run: "go run cmd/upx-obfuscator/main.go dist/win-release_windows_amd64_v1/go-socks5-ssh-proxy.exe" - - - name: Copy win64 release exe for dist - run: "cp dist/win-release_windows_amd64_v1/go-socks5-ssh-proxy.exe dist/chrome_proxy.exe" - - - name: Store win64 release exe for dist - uses: actions/upload-artifact@v4 - with: - name: ChromeProxyPlugin - path: | - dist/chrome_proxy.exe - - - name: Store all GoReleaser artifacts - uses: actions/upload-artifact@v4 - with: - name: dist-goreleaser - path: | - dist diff --git a/.github/workflows/goreleaser.yaml.snippet b/.github/workflows/goreleaser.yaml.snippet new file mode 100644 index 0000000..33fdaa6 --- /dev/null +++ b/.github/workflows/goreleaser.yaml.snippet @@ -0,0 +1,69 @@ + goreleaser: + name: Build releases with goreleaser + environment: prod + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + cache: true + check-latest: true + + - name: Set up MinGW + uses: egor-tensin/setup-mingw@v2 + with: + platform: x64 + + - name: Use config_release.go from action secrets + uses: mobiledevops/secret-to-file-action@v1 # TODO native in Makefile, can be unsafe... + with: + base64-encoded-secret: ${{ secrets.CONFIG_RELEASE_GO_FILE }} + filename: "config_release.go" + + - name: Use resources/ssh_private_key.base64.rot13 from action secrets + uses: mobiledevops/secret-to-file-action@v1 # TODO native in Makefile, can be unsafe... + with: + base64-encoded-secret: ${{ secrets.RESOURCES_SSH_PRIVATE_KEY_BASE64_ROT13 }} + filename: "ssh_private_key.base64.rot13" + working-directory: "./resources" + + - name: Install upx + run: sudo apt install upx + + - name: Install garble + run: make install-deps + + - name: Run GoReleaser to build releases + uses: goreleaser/goreleaser-action@v6 + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + # 'latest', 'nightly', or a semver + version: '~> v2' + args: release --clean --snapshot --id win-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # NOTE: Some virus and malware scanners detect mangled UPX headers and mark it as suspisious + #- name: Obfuscate UPX packed executable + # run: "go run cmd/upx-obfuscator/main.go dist/win-release_windows_amd64_v1/go-socks5-ssh-proxy.exe" + + - name: Copy win64 release exe for dist + run: "cp dist/win-release_windows_amd64_v1/go-socks5-ssh-proxy.exe dist/chrome_proxy.exe" + + - name: Store win64 release exe for dist + uses: actions/upload-artifact@v4 + with: + name: ChromeProxyPlugin + path: | + dist/chrome_proxy.exe + + - name: Store all GoReleaser artifacts + uses: actions/upload-artifact@v4 + with: + name: dist-goreleaser + path: | + dist