Bump to v0.92.1 -- CI and Linux build fixes #11
Workflow file for this run
This file contains hidden or 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
| name: release-build | |
| on: | |
| push: | |
| tags: ['v*'] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: ${{ matrix.platform }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - platform: linux-amd64 | |
| runner: ubuntu-22.04 | |
| os: linux | |
| arch: amd64 | |
| ext: tar.gz | |
| exe: "" | |
| - platform: linux-arm64 | |
| runner: ubuntu-22.04-arm | |
| os: linux | |
| arch: arm64 | |
| ext: tar.gz | |
| exe: "" | |
| - platform: darwin-amd64 | |
| runner: macos-15-intel | |
| os: darwin | |
| arch: amd64 | |
| ext: tar.gz | |
| exe: "" | |
| - platform: darwin-arm64 | |
| runner: macos-15 | |
| os: darwin | |
| arch: arm64 | |
| ext: tar.gz | |
| exe: "" | |
| - platform: windows-amd64 | |
| runner: windows-latest | |
| os: windows | |
| arch: amd64 | |
| ext: zip | |
| exe: ".exe" | |
| runs-on: ${{ matrix.runner }} | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| CC: ${{ matrix.os == 'windows' && 'gcc' || 'cc' }} | |
| TAG: ${{ github.ref_name }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Verify tag matches src/mino.h | |
| run: | | |
| src_ver="v$(awk ' | |
| /^#define MINO_VERSION_MAJOR/ {maj=$3} | |
| /^#define MINO_VERSION_MINOR/ {min=$3} | |
| /^#define MINO_VERSION_PATCH/ {pat=$3} | |
| END {print maj"."min"."pat} | |
| ' src/mino.h)" | |
| tag_base="${TAG%%-*}" | |
| if [ "$src_ver" != "$tag_base" ]; then | |
| echo "Tag $TAG (base $tag_base) does not match src/mino.h version $src_ver" >&2 | |
| exit 1 | |
| fi | |
| echo "Tag $TAG matches source version $src_ver" | |
| - name: Bootstrap mino | |
| run: | | |
| gen_header() { | |
| local src="$1" | |
| local sym="$2" | |
| local out="src/$sym.h" | |
| printf 'static const char *%s_src =\n' "$sym" > "$out" | |
| sed 's/\\/\\\\/g; s/"/\\"/g; s/^/ "/; s/$/\\n"/' "$src" >> "$out" | |
| printf ' ;\n' >> "$out" | |
| } | |
| gen_header src/core.clj core_mino | |
| gen_header lib/clojure/string.clj lib_clojure_string | |
| gen_header lib/clojure/set.clj lib_clojure_set | |
| gen_header lib/clojure/walk.clj lib_clojure_walk | |
| gen_header lib/clojure/edn.clj lib_clojure_edn | |
| gen_header lib/clojure/pprint.clj lib_clojure_pprint | |
| gen_header lib/clojure/zip.clj lib_clojure_zip | |
| gen_header lib/clojure/data.clj lib_clojure_data | |
| gen_header lib/clojure/test.clj lib_clojure_test | |
| gen_header lib/clojure/template.clj lib_clojure_template | |
| gen_header lib/clojure/repl.clj lib_clojure_repl | |
| gen_header lib/clojure/stacktrace.clj lib_clojure_stacktrace | |
| gen_header lib/clojure/datafy.clj lib_clojure_datafy | |
| gen_header lib/clojure/core/protocols.clj lib_clojure_core_protocols | |
| gen_header lib/clojure/instant.clj lib_clojure_instant | |
| gen_header lib/clojure/spec/alpha.clj lib_clojure_spec_alpha | |
| gen_header lib/clojure/core/specs/alpha.clj lib_clojure_core_specs_alpha | |
| $CC -std=c99 -O2 \ | |
| -Isrc -Isrc/public -Isrc/runtime -Isrc/gc -Isrc/eval \ | |
| -Isrc/collections -Isrc/prim -Isrc/async -Isrc/interop \ | |
| -Isrc/diag -Isrc/vendor/imath \ | |
| -o "mino${{ matrix.exe }}" \ | |
| src/public/*.c src/runtime/*.c src/gc/*.c src/eval/*.c \ | |
| src/collections/*.c src/prim/*.c src/async/*.c src/interop/*.c \ | |
| src/regex/*.c src/diag/*.c src/vendor/imath/*.c \ | |
| main.c -lm | |
| - name: Smoke test | |
| run: | | |
| "./mino${{ matrix.exe }}" --version | |
| out=$("./mino${{ matrix.exe }}" -e '(+ 1 2)') | |
| if [ "$out" != "3" ]; then | |
| echo "Smoke test failed: expected '3', got '$out'" >&2 | |
| exit 1 | |
| fi | |
| - name: Stage release directory | |
| run: | | |
| dir="mino_${{ matrix.os }}_${{ matrix.arch }}_${TAG}" | |
| mkdir -p "$dir" | |
| cp "mino${{ matrix.exe }}" "$dir/" | |
| cp LICENSE "$dir/" | |
| sed \ | |
| -e "s/__VERSION__/${TAG}/g" \ | |
| -e "s/__OS__/${{ matrix.os }}/g" \ | |
| -e "s/__ARCH__/${{ matrix.arch }}/g" \ | |
| .github/release-templates/release-readme.md > "$dir/README.md" | |
| echo "STAGE_DIR=$dir" >> "$GITHUB_ENV" | |
| - name: Archive | |
| run: | | |
| if [ "${{ matrix.ext }}" = "zip" ]; then | |
| 7z a -tzip "${STAGE_DIR}.zip" "${STAGE_DIR}" >/dev/null | |
| else | |
| tar -czf "${STAGE_DIR}.tar.gz" "${STAGE_DIR}" | |
| fi | |
| ls -la "${STAGE_DIR}.${{ matrix.ext }}" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform }} | |
| path: mino_${{ matrix.os }}_${{ matrix.arch }}_${{ github.ref_name }}.${{ matrix.ext }} | |
| if-no-files-found: error | |
| retention-days: 7 | |
| publish-draft: | |
| name: publish draft release | |
| needs: build | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Generate checksums.txt | |
| working-directory: dist | |
| run: | | |
| shasum -a 256 mino_* > checksums.txt | |
| cat checksums.txt | |
| - name: Create draft Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: ${{ github.ref_name }} | |
| draft: true | |
| prerelease: ${{ contains(github.ref_name, '-') }} | |
| fail_on_unmatched_files: true | |
| files: | | |
| dist/mino_* | |
| dist/checksums.txt |