From b5decc4b612f3565826fd5807b86c2cb930fde03 Mon Sep 17 00:00:00 2001 From: qydysky Date: Fri, 23 Oct 2020 15:43:12 +0800 Subject: [PATCH] fix dep --- .github/workflows/go.yml | 6 ++- .github/workflows/test.yml | 102 +++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e74d9c0..010a584 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -2,6 +2,8 @@ name: Go on: push: + branches: + - 'master' paths: - 'VERSION' @@ -38,7 +40,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: ^1.15.2 + go-version: ^1.15.3 id: go - name: Check out code @@ -83,7 +85,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: ^1.15.2 + go-version: ^1.15.3 id: go - name: Set up C diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..36d0453 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,102 @@ +name: Go + +on: + push: + branches: + - '!master' + paths: + - 'VERSION' + +jobs: + + Release_Drafter: + name: Release_Drafter + runs-on: ubuntu-latest + steps: + + - name: Release Drafter + # You may pin to the exact commit or the version. + # uses: release-drafter/release-drafter@06d4616a80cd7c09ea3cf12214165ad6c1859e67 + id: create_release + uses: release-drafter/release-drafter@v5.11.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: set upload_url + id: set_upload_url + uses: noobly314/share-data@v1 + with: + share-id: release_url + mode: set + key: url + value: ${{ steps.create_release.outputs.upload_url }} + + ubuntu_build: + name: ubuntu_build + needs: Release_Drafter + runs-on: ubuntu-latest + steps: + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ^1.15.3 + id: go + + - name: Check out code + uses: actions/checkout@v2 + + - name: Build + run: | + sudo apt-get install libgtk-3-dev libcairo2-dev libglib2.0-dev + go build -v -o demo/demo.run -i demo/main.go + + - name: zip + run: zip -q -r release_ubuntu.zip * + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v2.2.0 + with: + path: ./release_ubuntu.zip + + windows_build: + name: windows_build + needs: Release_Drafter + runs-on: windows-latest + steps: + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ^1.15.3 + id: go + + - name: Set up C + run: | + echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH + + - name: Set up Gtk + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + path-type: inherit + update: true + install: 'mingw-w64-x86_64-gtk3 mingw-w64-x86_64-gtk2' + + - name: Check out code + uses: actions/checkout@v2 + + - shell: msys2 {0} + run: | + export CGO_LDFLAGS_ALLOW="-Wl.*" + export CGO_CFLAGS_ALLOW="-Wl.*" + export CGO_CXXFLAGS_ALLOW="-Wl.*" + go build -v -buildmode=exe -o demo/demo.exe -i demo/main.go + + - name: zip + run: .\7za.exe a -r .\release_windows.zip ./ + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v2.2.0 + with: + path: ./release_windows.zip -- 2.39.2