From fa23f846c54db4e60d88e652be806933a4d05ade Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Mon, 30 Sep 2024 16:24:02 +0200 Subject: [PATCH] Added GitHub Actions workflow for building Launch5j. --- .github/workflows/build-l5j.yml | 108 ++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 .github/workflows/build-l5j.yml diff --git a/.github/workflows/build-l5j.yml b/.github/workflows/build-l5j.yml new file mode 100644 index 0000000..bf852d0 --- /dev/null +++ b/.github/workflows/build-l5j.yml @@ -0,0 +1,108 @@ +name: "CI/CD" +on: + push: + branches: ['**'] + pull_request: + release: + types: [published] + +jobs: + build: + name: Build Launch5j + runs-on: windows-2019 + strategy: + matrix: + include: + - flavor: "x86" + msystem: "MINGW32" + toolchain: "i686" + - flavor: "x64" + msystem: "MINGW64" + toolchain: "x86_64" + steps: + - uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.msystem }} + update: true + install: mingw-w64-${{ matrix.toolchain }}-toolchain base-devel git + - uses: actions/checkout@v4 + - shell: msys2 {0} + run: make -B + - uses: actions/upload-artifact@v4 + with: + name: launch5j-bin-${{ matrix.flavor }} + path: bin/*.exe + + example: + name: Build Example + runs-on: ubuntu-22.04 + steps: + - uses: actions/setup-java@v4 + with: + java-version: "8" + distribution: "temurin" + architecture: x64 + - uses: actions/checkout@v4 + - run: ant -noinput -buildfile src/example/build.xml + - uses: actions/upload-artifact@v4 + with: + name: launch5j-example + path: src/example/dist/example.jar + + docs: + name: Generate Docs + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: docker://pandoc/core:2.9 + with: + args: >- + -f markdown-implicit_figures -t html5 + --standalone --ascii --toc --toc-depth=2 + --css="etc/css/gh-pandoc.css" + -o "./README.html" "./README.yaml" "./README.md" + - uses: actions/upload-artifact@v4 + with: + name: launch5j-doc + path: | + LICENSE.txt + README.html + etc/img/*.png + etc/css/*.css + + release: + name: Generate Release Package + needs: [build, example, docs] + runs-on: ubuntu-22.04 + steps: + - uses: actions/download-artifact@v4 + with: + name: launch5j-doc + - uses: actions/download-artifact@v4 + with: + name: launch5j-bin-x86 + - uses: actions/download-artifact@v4 + with: + name: launch5j-bin-x64 + path: x64 + - uses: actions/download-artifact@v4 + with: + name: launch5j-example + path: example + - run: | + cp -f launch5j_x86_wrapped_registry.exe example/example.exe + dd if=example/example.jar of=example/example.exe oflag=append conv=notrunc + rm -f example/example.jar + - run: | + mkdir -p /var/tmp/launch5j-release + tar -czvf /var/tmp/launch5j-release/launch5j-bin.$(date +"%Y-%m-%d").tar.gz * + - uses: actions/upload-artifact@v4 + with: + name: launch5j-release + path: /var/tmp/launch5j-release/* + - if: ${{ github.event_name == 'release' }} + uses: Roang-zero1/github-upload-release-artifacts-action@v2 + with: + args: /var/tmp/launch5j-release/ + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file