From 850b14b5bf614213ff502749259bee973fb2cb3a Mon Sep 17 00:00:00 2001 From: Yiwen-Chan Date: Thu, 18 Mar 2021 18:45:07 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20=E6=9B=B4=E6=96=B0=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/linux.yml | 24 +++--------------------- .github/workflows/windows.yml | 23 ++--------------------- 2 files changed, 5 insertions(+), 42 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index dd51a175..ac8460a9 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,11 +1,8 @@ -name: Compile ZeroBot-Plugin +name: Compile ZeroBot-Plugin-linux on: push: branches: - master - release: - types: - - created env: GITHUB_TOKEN: ${{ github.token }} @@ -36,25 +33,10 @@ jobs: run: go mod tidy - name: Build - run: go build -o artifacts/ZeroBot-Plugin-linux + run: go build -ldflags="-s -w" -o artifacts/ZeroBot-Plugin-linux - name: Upload Build Artifact uses: actions/upload-artifact@v2 with: - # Artifact name name: ZeroBot-Plugin-linux - # A file, directory or wildcard pattern that describes what to upload - path: ./artifacts - - - name: Gets latest created release info - id: latest_release_info - uses: jossef/action-latest-release-info@v1.1.0 - - - name: Upload asset to github release page - id: upload-release-asset - uses: actions/upload-release-asset@v1 - with: - upload_url: ${{ steps.latest_release_info.outputs.upload_url }} - asset_path: ./artifacts/ZeroBot-Plugin-linux - asset_name: ZeroBot-Plugin-linux - asset_content_type: application/zip \ No newline at end of file + path: ./artifacts \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1ccb8c6c..1e0293b2 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,11 +1,8 @@ -name: Compile ZeroBot-Plugin +name: Compile ZeroBot-Plugin-windows on: push: branches: - master - release: - types: - - created env: GITHUB_TOKEN: ${{ github.token }} @@ -28,7 +25,6 @@ jobs: id: cache uses: actions/cache@v2 with: - # A list of files, directories, and wildcard patterns to cache and restore path: ~/go/pkg/mod key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} @@ -36,25 +32,10 @@ jobs: run: go mod tidy - name: Build - run: go build -o artifacts/ZeroBot-Plugin-windows.exe + run: go build -ldflags="-s -w" -o artifacts/ZeroBot-Plugin-windows.exe - name: Upload Build Artifact uses: actions/upload-artifact@v2 with: - # Artifact name name: ZeroBot-Plugin-windows.exe - # A file, directory or wildcard pattern that describes what to upload path: ./artifacts - - - name: Gets latest created release info - id: latest_release_info - uses: jossef/action-latest-release-info@v1.1.0 - - - name: Upload asset to github release page - id: upload-release-asset - uses: actions/upload-release-asset@v1 - with: - upload_url: ${{ steps.latest_release_info.outputs.upload_url }} - asset_path: ./artifacts/ZeroBot-Plugin-windows.exe - asset_name: ZeroBot-Plugin-windows.exe - asset_content_type: application/zip \ No newline at end of file