From 820640b2b7a4f3915d33d2dbe8eb0c4d6bd0a898 Mon Sep 17 00:00:00 2001 From: Alyxia Sother Date: Tue, 16 Aug 2022 14:44:58 +0200 Subject: [PATCH] [CI] Bump Go version --- .github/workflows/release.yml | 322 +++++++++++++++++----------------- go.mod | 2 +- 2 files changed, 162 insertions(+), 162 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f000e41..dbbbf4f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,161 +1,161 @@ -name: Release -on: - push: - tags: - - v* - -env: - FORCE_COLOR: true - -jobs: - build-linux: - runs-on: ubuntu-latest - - steps: - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: "1.17.1" - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Install Linux dependencies - run: | - sudo apt update - sudo apt install -y wget pkg-config libsdl2-dev - - name: Install Go dependencies - run: go get -v - - - name: Build - run: CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -tags static -ldflags "-s -w" - - - name: Update executable - run: | - chmod +x installer - mv installer installer.Linux - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: installer-linux - path: installer.Linux - - build-mac: - runs-on: macos-latest - - steps: - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: "1.17.1" - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Install dependencies - run: brew install pkg-config sdl2 - - - name: Install Go dependencies - run: go get -v - - - name: Build - run: CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -v -tags static -ldflags "-s -w" - - - name: Update executable - run: | - chmod +x installer - - name: Generate MacOS bundle - run: | - mkdir -p Installer.app/Contents/MacOS - mkdir -p Installer.app/Contents/Resources - wget https://public.alyxia.dev/replugged/Info.plist -O Installer.app/Contents/Info.plist - mv installer Installer.app/Contents/MacOS/installer - wget https://public.alyxia.dev/replugged/icon.icns -O Installer.app/Contents/Resources/icon.icns - zip -r Installer.MacOS.zip Installer.app - mv Installer.MacOS.zip installer.MacOS.zip - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: installer-macos - path: installer.MacOS.zip - - build-windows: - runs-on: windows-latest - - steps: - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: "1.17.1" - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup MSYS2 - uses: msys2/setup-msys2@v2 - - - name: Install Windows dependencies - shell: msys2 {0} - run: | - pacman -S --noconfirm git mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 mingw-w64-x86_64-go - export GOROOT=/mingw64/lib/go - export GOPATH=/mingw64 - - name: Install Go dependencies - shell: msys2 {0} - run: | - export GOROOT=/mingw64/lib/go - export GOPATH=/mingw64 - go get -v - - name: Build - shell: msys2 {0} - run: | - export GOROOT=/mingw64/lib/go - export GOPATH=/mingw64 - CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -v -tags static -ldflags "-s -w -H=windowsgui" - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: installer-windows - path: installer.exe - - release: - runs-on: ubuntu-latest - needs: [build-linux, build-mac, build-windows] - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - uses: actions/download-artifact@v2 - with: - name: installer-linux - path: linux - - - uses: actions/download-artifact@v2 - with: - name: installer-macos - path: macos - - - uses: actions/download-artifact@v2 - with: - name: installer-windows - path: windows - - - name: Get some values needed for the release - id: release_values - run: | - echo "::set-output name=date::$(date '+%Y-%m-%d')" - echo "::set-output name=tag::${GITHUB_REF#refs/tags/}" - - name: Create the release - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.ALYX_TOKEN }} - with: - name: ${{ steps.release_values.outputs.tag }}, ${{ steps.release_values.outputs.date }} - draft: true - prerelease: false - body_path: .github/release_body_template.md - files: | - linux/installer.Linux - macos/installer.MacOS.zip - windows/installer.exe +name: Release +on: + push: + tags: + - v* + +env: + FORCE_COLOR: true + +jobs: + build-linux: + runs-on: ubuntu-latest + + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: "1.19" + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install Linux dependencies + run: | + sudo apt update + sudo apt install -y wget pkg-config libsdl2-dev + - name: Install Go dependencies + run: go get -v + + - name: Build + run: CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -tags static -ldflags "-s -w" + + - name: Update executable + run: | + chmod +x installer + mv installer installer.Linux + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: installer-linux + path: installer.Linux + + build-mac: + runs-on: macos-latest + + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: "1.19" + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install dependencies + run: brew install pkg-config sdl2 + + - name: Install Go dependencies + run: go get -v + + - name: Build + run: CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -v -tags static -ldflags "-s -w" + + - name: Update executable + run: | + chmod +x installer + - name: Generate MacOS bundle + run: | + mkdir -p Installer.app/Contents/MacOS + mkdir -p Installer.app/Contents/Resources + wget https://public.alyxia.dev/replugged/Info.plist -O Installer.app/Contents/Info.plist + mv installer Installer.app/Contents/MacOS/installer + wget https://public.alyxia.dev/replugged/icon.icns -O Installer.app/Contents/Resources/icon.icns + zip -r Installer.MacOS.zip Installer.app + mv Installer.MacOS.zip installer.MacOS.zip + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: installer-macos + path: installer.MacOS.zip + + build-windows: + runs-on: windows-latest + + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: "1.19" + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup MSYS2 + uses: msys2/setup-msys2@v2 + + - name: Install Windows dependencies + shell: msys2 {0} + run: | + pacman -S --noconfirm git mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 mingw-w64-x86_64-go + export GOROOT=/mingw64/lib/go + export GOPATH=/mingw64 + - name: Install Go dependencies + shell: msys2 {0} + run: | + export GOROOT=/mingw64/lib/go + export GOPATH=/mingw64 + go get -v + - name: Build + shell: msys2 {0} + run: | + export GOROOT=/mingw64/lib/go + export GOPATH=/mingw64 + CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -v -tags static -ldflags "-s -w -H=windowsgui" + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: installer-windows + path: installer.exe + + release: + runs-on: ubuntu-latest + needs: [build-linux, build-mac, build-windows] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - uses: actions/download-artifact@v2 + with: + name: installer-linux + path: linux + + - uses: actions/download-artifact@v2 + with: + name: installer-macos + path: macos + + - uses: actions/download-artifact@v2 + with: + name: installer-windows + path: windows + + - name: Get some values needed for the release + id: release_values + run: | + echo "::set-output name=date::$(date '+%Y-%m-%d')" + echo "::set-output name=tag::${GITHUB_REF#refs/tags/}" + - name: Create the release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.ALYX_TOKEN }} + with: + name: ${{ steps.release_values.outputs.tag }}, ${{ steps.release_values.outputs.date }} + draft: true + prerelease: false + body_path: .github/release_body_template.md + files: | + linux/installer.Linux + macos/installer.MacOS.zip + windows/installer.exe diff --git a/go.mod b/go.mod index 5de1480..8b21cf9 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/replugged-org/installer -go 1.18 +go 1.19 require ( github.com/ProtonMail/go-appdir v1.1.0