From 245d97c795f3038aba0e74e70e8e2d9212017c8a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 15:02:51 +0000 Subject: [PATCH 1/2] Initial plan From 6725da4b77e741dac33577eb84938834eb31329b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 15:08:07 +0000 Subject: [PATCH 2/2] Add GitHub Actions for CI and Release workflows Co-authored-by: hugefiver <18693500+hugefiver@users.noreply.github.com> --- .github/workflows/ci.yml | 35 +++++++++++++++ .github/workflows/release.yml | 83 +++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a81b21b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +permissions: + contents: read + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Racket + uses: Bogdanp/setup-racket@v1.11 + with: + architecture: x64 + distribution: full + version: stable + + - name: Compile + run: | + raco make randstr/main.rkt + raco make randstr/cli/main.rkt + + - name: Run tests + run: | + racket randstr/tests/test.rkt + racket randstr/tests/test-extensions.rkt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6ebe41c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,83 @@ +name: Release + +on: + release: + types: [published] + +permissions: + contents: write + +jobs: + build-executables: + strategy: + matrix: + include: + - os: ubuntu-latest + platform: linux + arch: x64 + ext: "" + - os: macos-13 + platform: macos + arch: x64 + ext: "" + - os: macos-latest + platform: macos + arch: arm64 + ext: "" + - os: windows-latest + platform: windows + arch: x64 + ext: ".exe" + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Racket + uses: Bogdanp/setup-racket@v1.11 + with: + architecture: ${{ matrix.arch }} + distribution: full + version: stable + + - name: Compile + run: | + raco make randstr/main.rkt + raco make randstr/cli/main.rkt + + - name: Build executable + run: raco exe -o randstr${{ matrix.ext }} randstr/cli/main.rkt + + - name: Create distribution (Unix) + if: matrix.platform != 'windows' + run: raco distribute dist randstr + + - name: Create distribution (Windows) + if: matrix.platform == 'windows' + run: raco distribute dist randstr.exe + + - name: Archive distribution (Unix) + if: matrix.platform != 'windows' + run: | + cd dist + tar -czvf ../randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz . + + - name: Archive distribution (Windows) + if: matrix.platform == 'windows' + shell: pwsh + run: | + Compress-Archive -Path dist/* -DestinationPath randstr-${{ matrix.platform }}-${{ matrix.arch }}.zip + + - name: Upload release asset (Unix) + if: matrix.platform != 'windows' + uses: softprops/action-gh-release@v2 + with: + files: randstr-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz + + - name: Upload release asset (Windows) + if: matrix.platform == 'windows' + uses: softprops/action-gh-release@v2 + with: + files: randstr-${{ matrix.platform }}-${{ matrix.arch }}.zip