diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..d7d5265 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,29 @@ +on: + push: + tags: + - "v*.*.*" + +jobs: + goreleaser: + runs-on: macos-latest + permissions: write-all + steps: + - uses: actions/checkout@v3 + - run: git fetch --force --tags + - run: brew install mingw-w64 + - working-directory: /tmp + run: | + wget https://github.com/mstorsjo/llvm-mingw/releases/download/20230427/llvm-mingw-20230427-ucrt-macos-universal.tar.xz + gunzip llvm-mingw-20230427-ucrt-macos-universal.tar.xz + tar xf llvm-mingw-20230427-ucrt-macos-universal.tar + - uses: actions/setup-go@v3 + with: + go-version: '>=1.19.1' + cache: true + - uses: goreleaser/goreleaser-action@v2 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..7bf70c1 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,44 @@ +project_name: irestore +builds: + - id: darwin-build + main: ./cmd/irestore + env: + - CGO_ENABLED=1 + goos: + - darwin + - id: windows-build-amd64 + main: ./cmd/irestore + ldflags: -buildmode=exe + env: + - CGO_ENABLED=1 + - CC=x86_64-w64-mingw32-gcc + - CXX=x86_64-w64-mingw32-g++ + goos: + - windows + goarch: + - amd64 + - id: windows-build-arm64 + main: ./cmd/irestore + ldflags: -buildmode=exe + env: + - CGO_ENABLED=1 + - CC=/tmp/llvm-mingw-20230427-ucrt-macos-universal/bin/aarch64-w64-mingw32-gcc + - CXX=/tmp/llvm-mingw-20230427-ucrt-macos-universal/bin/aarch64-w64-mingw32-g++ + goos: + - windows + goarch: + - arm64 + - id: windows-build-386 + main: ./cmd/irestore + ldflags: -buildmode=exe + env: + - CGO_ENABLED=1 + - CC=i686-w64-mingw32-gcc + - CXX=i686-w64-mingw32-g++ + goos: + - windows + goarch: + - 386 + +checksum: + name_template: 'checksums.txt'