From 5153650d436187421d4c043bb93430bc31ccf7f2 Mon Sep 17 00:00:00 2001 From: Shrivu Shankar Date: Sat, 28 Sep 2024 15:45:29 -0700 Subject: [PATCH] tweaks --- .github/workflows/release.yml | 73 ++++++++++++++++++----------------- .goreleaser.yml | 67 -------------------------------- 2 files changed, 38 insertions(+), 102 deletions(-) delete mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00145fa..fff0fab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: release +name: Release on: push: @@ -6,38 +6,41 @@ on: - '*' jobs: - goreleaser: - runs-on: ubuntu-latest + build-and-release: + name: Build and Release + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, macos-latest] + include: + - os: windows-latest + output_name: screen_complete.exe + - os: macos-latest + output_name: screen_complete + steps: - - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: '^1.23.1' - - - name: Set up Cross-compile ENV - run: | - sudo apt update - sudo apt install gcc libc6-dev - sudo apt install libx11-dev xorg-dev libxtst-dev libpng++-dev - sudo apt install xcb libxcb-xkb-dev x11-xkb-utils libx11-xcb-dev libxkbcommon-x11-dev - sudo apt install libxkbcommon-dev - sudo apt install xsel xclip - sudo apt-get install gcc-multilib - sudo apt-get install gcc-mingw-w64 - sudo apt install libz-mingw-w64-dev - - - name: Install GoReleaser - uses: goreleaser/goreleaser-action@v2 - with: - install-only: true - - - name: GoReleaser Release - run: goreleaser - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Set up GCC + uses: egor-tensin/setup-gcc@v1 + with: + version: latest + platform: x64 + + - name: Build + run: | + go build -o ${{ matrix.output_name }} ./cmd/screen_complete + + - name: Create Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: ${{ matrix.output_name }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml deleted file mode 100644 index 9bc860b..0000000 --- a/.goreleaser.yml +++ /dev/null @@ -1,67 +0,0 @@ -version: 2 - -before: - hooks: - - go mod tidy - -builds: - - id: "ScreenComplete-Win64bit" - main: "./cmd/screen_complete" - env: - - CGO_ENABLED=1 - - CC=x86_64-w64-mingw32-gcc - - CXX=x86_64-w64-mingw32-g++ - goos: - - windows - goarch: - - amd64 - - - id: "ScreenComplete-Win32bit" - main: "./cmd/screen_complete" - env: - - CGO_ENABLED=1 - - CC=i686-w64-mingw32-gcc - - CXX=i686-w64-mingw32-g++ - goos: - - windows - goarch: - - 386 - - - id: "ScreenComplete-OSX" - main: "./cmd/screen_complete" - env: - - CGO_ENABLED=1 - goos: - - darwin - goarch: - - amd64 - - arm64 - -archives: - - format_overrides: - - goos: windows - format: zip - - goos: darwin - format: zip - files: - - configs/configs.json - - configs/**/* - - README.md - - LICENSE - name_template: >- - {{ .ProjectName }}_ - {{- title .Os }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - -checksum: - name_template: 'checksums.txt' - -snapshot: - version_template: "{{ incpatch .Version }}-next" - -changelog: - sort: asc - filters: - exclude: \ No newline at end of file