-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #282 from Wieku/dev
0.8.0
- Loading branch information
Showing
82 changed files
with
2,367 additions
and
1,047 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
name: Build danser | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Danser version' | ||
type: string | ||
required: true | ||
draft: | ||
description: 'Create draft release' | ||
type: boolean | ||
required: false | ||
default: true | ||
|
||
jobs: | ||
build_windows: | ||
name: Building windows version | ||
runs-on: windows-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Checkout master branch | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install winlibs | ||
uses: bwoodsend/setup-winlibs-action@v1 | ||
|
||
- name: Install golang | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.19' | ||
cache: true | ||
|
||
- name: Build danser | ||
run: | | ||
version="${{ github.event.inputs.version }}" | ||
./dist-win.sh $version | ||
if [ ! -f "dist/artifacts/danser-${version// /-s}-win.zip" ]; then | ||
echo "Danser failed to build" | ||
exit 1 | ||
fi | ||
id: build | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ !failure() && steps.build.conclusion != 'failure' }} | ||
with: | ||
name: danser | ||
path: dist/artifacts/* | ||
|
||
build_linux: | ||
name: Building linux version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout master branch | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install needed packages | ||
run: sudo apt-get install xorg-dev libgl1-mesa-dev libgtk-3-dev | ||
|
||
- name: Install golang | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.19' | ||
cache: true | ||
|
||
- name: Build danser | ||
run: | | ||
version="${{ github.event.inputs.version }}" | ||
chmod +x dist-linux.sh | ||
./dist-linux.sh $version | ||
if [ ! -f "dist/artifacts/danser-${version// /-s}-linux.zip" ]; then | ||
echo "Danser failed to build" | ||
exit 1 | ||
fi | ||
id: build | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ !failure() && steps.build.conclusion != 'failure' }} | ||
with: | ||
name: danser | ||
path: dist/artifacts/* | ||
|
||
publish_release: | ||
name: Publish draft release | ||
if: ${{ !cancelled() && needs.build_windows.result == 'success' && needs.build_linux.result == 'success' && github.event.inputs.draft }} | ||
needs: [build_windows, build_linux] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: danser | ||
path: artifacts | ||
- name: Create release | ||
id: create_release | ||
run: | | ||
set -xe | ||
shopt -s nullglob | ||
version="${{ github.event.inputs.version }}" | ||
NAME="${version// / snapshot }" | ||
TAGNAME="${version// /-s}" | ||
hub release create --draft $(for a in artifacts/*.{zip,tar.xz}; do echo -a $a; done) -m "$NAME" -t "master" "$TAGNAME" | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.