diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b3c69e..5fe5c73 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,145 +12,161 @@ jobs: name: Linux Build runs-on: ubuntu-latest steps: - - name: Install Dependencies - run: sudo apt install gcc libgtk-3-dev libappindicator3-dev libwebkit2gtk-4.0-dev - - - name: Checkout - uses: actions/checkout@v2 - - - name: Unshallow - run: git fetch --prune --unshallow - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.14 - - - name: Run Builds - run: | - rm -rf ./out - ./build.sh linux server - # ./build.sh linux desktop - Linux desktop build is not currently supported. - - name: Upload Build Artifact - uses: actions/upload-artifact@v2 - with: - # Artifact name - # name: # optional - path: ./out/**/* - + - name: Install Dependencies + run: sudo apt install gcc libgtk-3-dev libappindicator3-dev libwebkit2gtk-4.0-dev + - + name: Checkout + uses: actions/checkout@v2 + - + name: Unshallow + run: git fetch --prune --unshallow + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + - + name: Run Builds + run: | + rm -rf ./out + ./build.sh linux server + # ./build.sh linux desktop - Linux desktop build is not currently supported. + - name: Upload Build Artifact + uses: actions/upload-artifact@v2 + with: + # Artifact name + # name: # optional + path: ./out/**/* + build-darwin: name: Darwin Build runs-on: macos-latest steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Unshallow - run: git fetch --prune --unshallow - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.14 - - - name: Run Builds - run: | - rm -rf ./out - ./build.sh darwin server - ./build.sh darwin desktop - - name: Upload Build Artifact - uses: actions/upload-artifact@v2 - with: - # Artifact name - # name: # optional - path: ./out/**/* - + - + name: Checkout + uses: actions/checkout@v2 + - + name: Unshallow + run: git fetch --prune --unshallow + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + - + name: Run Builds + run: | + rm -rf ./out + ./build.sh darwin server + ./build.sh darwin desktop + - name: Upload Build Artifact + uses: actions/upload-artifact@v2 + with: + # Artifact name + # name: # optional + path: ./out/**/* + build-windows: name: Windows Build runs-on: ubuntu-latest steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Unshallow - run: git fetch --prune --unshallow - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.14 - - - name: Run Builds - run: | - rm -rf ./out - ./build.sh windows server - ./build.sh windows desktop - - name: Upload Build Artifact - uses: actions/upload-artifact@v2 - with: - # Artifact name - # name: # optional - path: ./out/**/* + - + name: Checkout + uses: actions/checkout@v2 + - + name: Unshallow + run: git fetch --prune --unshallow + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + - + name: Run Builds + run: | + rm -rf ./out + ./build.sh windows server + ./build.sh windows desktop + - name: Upload Build Artifact + uses: actions/upload-artifact@v2 + with: + # Artifact name + # name: # optional + path: ./out/**/* generate-release: name: Execute Release runs-on: ubuntu-latest needs: [build-linux, build-darwin, build-windows] steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Unshallow - run: git fetch --prune --unshallow - - - name: Prepare Release Directory - run: mkdir ./release - - - name: Download a Build Artifact - uses: actions/download-artifact@v2 - with: - # Destination path - path: ./release # optional - - - name: Load version information - run: | - source ./version.properties - echo "::set-env name=VERSION_NAME::$VERSION_NAME" - echo "::set-env name=VERSION_CODE::$VERSION_CODE" - - - name: Display structure of downloaded files - working-directory: ./release - run: | - ls -R - - - name: Create a Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - # The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag - tag_name: "v${{ env.VERSION_NAME }}" - # The name of the release. For example, `Release v1.0.1` - release_name: "Release v${{ env.VERSION_NAME }}" - # Text describing the contents of the tag. - body: "" - draft: false - prerelease: false - - - name: Upload Release Asset - id: upload_release_assets - uses: NBTX/upload-release-assets@v2.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - targets: "./release/artifact/**/*" - - + - + name: Checkout + uses: actions/checkout@v2 + - + name: Unshallow + run: git fetch --prune --unshallow + - + name: Prepare Release Directory + run: mkdir ./release + - + name: Download a Build Artifact + uses: actions/download-artifact@v2 + with: + # Destination path + path: ./release # optional + - + name: Load version information + run: | + source ./version.properties + echo "::set-env name=VERSION_NAME::$VERSION_NAME" + echo "::set-env name=VERSION_CODE::$VERSION_CODE" + - + name: Display structure of downloaded files + working-directory: ./release + run: | + ls -R + - + name: Create a Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag + tag_name: "v${{ env.VERSION_NAME }}" + # The name of the release. For example, `Release v1.0.1` + release_name: "Release v${{ env.VERSION_NAME }}" + # Text describing the contents of the tag. + body: "" + draft: false + prerelease: false + - + name: Upload Windows Release Assets + id: upload_release_assets_windows + uses: NBTX/upload-release-assets@v2.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + targets: "./release/artifact/windows-*/*.exe" + - + name: Upload Linux Release Assets + id: upload_release_assets_linux + uses: NBTX/upload-release-assets@v2.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + targets: "./release/artifact/linux-*/*.!(md)" + - + name: Upload Darwin Release Assets + id: upload_release_assets_darwin + uses: NBTX/upload-release-assets@v2.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + targets: "./release/artifact/darwin-*/*.zip"