From cb4d589192aa2681128d8385d295879649fde0d6 Mon Sep 17 00:00:00 2001 From: h1romas4 Date: Tue, 27 Jun 2023 20:10:19 +0900 Subject: [PATCH] fix github actions --- .editorconfig | 3 ++ .../workflows/{msx.yml => build-release.yml} | 28 +++++++++++++++---- .github/workflows/build.yml | 15 ++++++++++ .github/workflows/release.yml | 15 ++++++++++ README.md | 4 +-- 5 files changed, 58 insertions(+), 7 deletions(-) rename .github/workflows/{msx.yml => build-release.yml} (52%) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml diff --git a/.editorconfig b/.editorconfig index 71ca37d..50d9f70 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,3 +13,6 @@ insert_final_newline = true [*.json] indent_size = 2 + +[*.yml] +indent_size = 2 diff --git a/.github/workflows/msx.yml b/.github/workflows/build-release.yml similarity index 52% rename from .github/workflows/msx.yml rename to .github/workflows/build-release.yml index e5f1772..e90b49c 100644 --- a/.github/workflows/msx.yml +++ b/.github/workflows/build-release.yml @@ -1,9 +1,12 @@ -name: Build +name: Build-Release on: - push: - branches: - - main + workflow_call: + inputs: + release: + description: 'release' + type: boolean + required: true jobs: build: @@ -12,11 +15,13 @@ jobs: - uses: actions/checkout@v1 with: submodules: recursive - token: ${{secrets.GITHUB_TOKEN}} + token: ${{ secrets.GITHUB_TOKEN }} + - name: Z88DK Toolchain Setup run: | sudo snap install z88dk --beta sudo apt install cmake ninja-build + - name: Build run: | export Z88DK_HOME=/snap/z88dk/current @@ -26,3 +31,16 @@ jobs: cd build /usr/bin/cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/z88dk.cmake -GNinja .. ninja + + - name: Check + run: | + TARGET=dist/noborunoca.rom + ls -laF ${TARGET} + file ${TARGET} | grep 'MSX ROM' | grep '0x4010' + md5sum ${TARGET} + + - uses: ncipollo/release-action@v1 + if: ${{ inputs.release }} + with: + artifacts: "dist/noborunoca.rom" + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6138df2 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,15 @@ +name: Build + +on: + push: + branches: + - main + +permissions: + contents: read + +jobs: + build: + uses: ./.github/workflows/build-release.yml + with: + release: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8982588 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,15 @@ +name: Release + +on: + push: + tags: + - '*' + +permissions: + contents: write + +jobs: + build: + uses: ./.github/workflows/build-release.yml + with: + release: true diff --git a/README.md b/README.md index b6a023f..45082ff 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # MSX Game "NOBORUNOCA" -![](https://github.com/h1romas4/noborunoca/workflows/Build/badge.svg) +![](https://github.com/h1romas4/noborunoca/workflows/Build/badge.svg) ![](https://github.com/h1romas4/noborunoca/workflows/Release/badge.svg) ![](https://raw.githubusercontent.com/h1romas4/noborunoca/main/docs/noborunoca-01.png) -🎮 [Let's Play! by WebMSX](https://webmsx.org/?MACHINE=MSX2J&ROM=https://github.com/h1romas4/noborunoca/releases/download/v1.0.0/noborunoca.rom) +🎮 [Let's Play! by WebMSX](https://webmsx.org/?MACHINE=MSX2J&ROM=https://github.com/h1romas4/noborunoca/releases/download/v1.0.1/noborunoca.rom) 📼 [YouTube Video](https://www.youtube.com/watch?v=SFgWwkPuj2M)