Upload release artifacts seperately

This commit is contained in:
NBTX 2020-06-09 17:54:07 +01:00
parent f8a181403a
commit 66c7aa9f9d

View file

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