Pārlūkot izejas kodu

change go build -- remove main.go

Matthew R. Kasun 3 gadi atpakaļ
vecāks
revīzija
a1526a5780
1 mainītis faili ar 64 papildinājumiem un 7 dzēšanām
  1. 64 7
      .github/workflows/buildandrelease.yml

+ 64 - 7
.github/workflows/buildandrelease.yml

@@ -420,11 +420,8 @@ jobs:
       - name: Build
         run: |
           cd netclient
-          env GOOS=darwin GOARCH=amd64 go build -tags=gui -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-darwin/netclient .
-          env CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -tags=gui -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-darwin-arm64/netclient main.go
-          env GOOS=darwin GOARCH=amd64 go build -tags=gui -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-darwin/netclient .
-          env GOOS=darwin GOARCH=arm64 go build -tags=gui -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-darwin-arm64/netclient .
-#          env GOOS=darwin GOARCH=arm64 go build -tags=gui -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-darwin-arm64/netclient .
+          env GOARCH=amd64 go build -tags=gui -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-darwin/netclient .
+          env GOARCH=arm64 go build -tags=gui -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient-darwin-arm64/netclient .
       - name: Upload darwin-amd64 to Release
         uses: svenstaro/upload-release-action@v2
         with:
@@ -435,8 +432,68 @@ jobs:
           prerelease: true
           asset_name: netclient-darwin
 
-#      - name: Upload darwin-arm64 to Release
-#        uses: svenstaro/upload-release-action@v2
+      - name: Upload darwin-arm64 to Release
+        uses: svenstaro/upload-release-action@v2
+        with:
+          repo_token: ${{ secrets.GITHUB_TOKEN }}
+          file: netclient/build/netclient-darwin-arm64/netclient
+          tag: ${{ env.NETMAKER_VERSION }}
+          overwrite: true
+          prerelease: true
+          asset_name: netclient-darwin-arm64
+
+  netclient-windows:
+    runs-on: windows-latest
+    needs: version
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+      - name: Set Variables
+        run: |
+          TAG=${{needs.version.outputs.tag}}
+          VERSION=${{needs.version.outputs.version}}
+          echo "NETMAKER_VERSION=${TAG}"  >> $GITHUB_ENV
+          echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
+        shell: bash
+      - name: Setup go
+        uses: actions/setup-go@v3
+        with:
+          go-version: 1.18
+      - name: Mysys2 setup
+        uses: msys2/setup-msys2@v2
+        with:
+          install: >-
+            git
+            mingw-w64-x86_64-toolchain
+      - name: Build
+        run: |
+          echo $(go env GOPATH)/bin >> $GITHUB_PATH
+          cd netclient
+          go get -v github.com/josephspurrier/goversioninfo
+          go install -v github.com/josephspurrier/goversioninfo/cmd/goversioninfo
+          go generate
+          go build -tags=gui -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient.exe .
+
+      - name: Upload netclient windows to Release
+        continue-on-error: true
+        uses: svenstaro/upload-release-action@v2
+        with:
+          repo_token: ${{ secrets.GITHUB_TOKEN }}
+          file: netclient/build/netclient.exe
+          tag: ${{ env.NETMAKER_VERSION }}
+          overwrite: true
+          prerelease: true
+          asset_name: netclient.exe
+
+#  linux-packages:
+#    runs-on: ubuntu-latest
+#    needs: |
+#      version
+#      netclient-x86
+#      netclien-arm
+#    steps:
+#      - name: Repository Dispatch
+#        uses: peter-evans/[email protected]
 #        with:
 #          repo_token: ${{ secrets.GITHUB_TOKEN }}
 #          file: netclient/build/netclient-darwin-arm64/netclient