From 32d5da7ac0bf2cff2c67bbbfe3425ada2d538e86 Mon Sep 17 00:00:00 2001 From: ifilot Date: Sun, 1 Sep 2024 16:51:46 +0200 Subject: [PATCH] Initial commit GA --- .github/workflows/build.yml | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..48a16cd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,69 @@ +name: build + +on: + push: + branches: [ "master", "develop" ] + tags: + - 'v*' + pull_request: + branches: [ "master", "develop" ] + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y build-essential cc65 python3 python3-numpy python3-pilkit zip + - name: Compile + run: cd src && make + - name: Package + run: cd src && zip CX16-KAKURO.ZIP KAKURO.PRG *.DAT *.ZSM + - name: Package + run: zip --junk-paths CX16-KAKURO.ZIP src/KAKURO.PRG src/*.DAT src/*.ZSM + - name: Upload package + uses: actions/upload-artifact@v4 + with: + name: CX16-KAKURO.ZIP + path: CX16-KAKURO.ZIP + + create-release: + runs-on: ubuntu-latest + permissions: write-all + if: startsWith(github.ref, 'refs/tags/v') + steps: + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + + deploy-package: + runs-on: ubuntu-latest + needs: [build, create-release] + permissions: write-all + if: startsWith(github.ref, 'refs/tags/v') + steps: + - name: Download package + uses: actions/download-artifact@v4 + with: + name: CX16-KAKURO.ZIP + path: ./ + - name: Upload Release Asset + id: upload-release-asset-launcher + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_path: ./CX16-KAKURO.ZIP + asset_name: CX16-KAKURO.ZIP + asset_content_type: application/zip \ No newline at end of file