name: Rolling Release on: push: branches: [main] pull_request: workflow_dispatch: # Never cancelled, so a newer push can't interrupt a release half way. concurrency: group: rolling-${{ github.ref }} cancel-in-progress: false permissions: contents: read env: MOONBIT_VERSION: 0.10.20+65efd5b93 ZIG_VERSION: 0.17.1 ZIG_SHA256: 3581863e3cbcfd0fce0efc682ce7e9e93da96668a977791d356a26d2a7e9b17a jobs: build: runs-on: depot-ubuntu-24.04-4 timeout-minutes: 30 steps: - uses: actions/checkout@v4 - name: Install build tools run: | missing= for tool in gcc make perl readelf curl xz; do command -v "$tool" >/dev/null || missing=1 done if [ -n "$missing" ]; then sudo apt-get update -qq sudo apt-get install -y -qq --no-install-recommends build-essential perl curl xz-utils >/dev/null fi - name: Install MoonBit run: | curl -fsSL --retry 5 https://cli.moonbitlang.com/install/unix.sh | bash -s -- "$MOONBIT_VERSION" echo "$HOME/.moon/bin" >> "$GITHUB_PATH" "$HOME/.moon/bin/moon" update "$HOME/.moon/bin/moon" version --all - name: Install Zig run: | curl -fsSL --retry 5 -o "$RUNNER_TEMP/zig.tar.xz" \ "https://ziglang.org/download/$ZIG_VERSION/zig-x86_64-linux-$ZIG_VERSION.tar.xz" echo "$ZIG_SHA256 $RUNNER_TEMP/zig.tar.xz" | sha256sum -c - tar -xJf "$RUNNER_TEMP/zig.tar.xz" -C "$RUNNER_TEMP" echo "$RUNNER_TEMP/zig-x86_64-linux-$ZIG_VERSION" >> "$GITHUB_PATH" - name: Test run: moon test --target native - name: Build static binary run: scripts/build-musl.sh # A real HTTPS install: proves the linked-in OpenSSL and CA lookup work. - name: Smoke test run: | export ORBIT_ROOT="$RUNNER_TEMP/orbit-smoke" dist/orbit-linux-x86_64 install hello "$ORBIT_ROOT/bin/hello" - uses: actions/upload-artifact@v3 with: name: orbit-linux-x86_64 path: dist/ if-no-files-found: error publish: needs: build if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' runs-on: depot-ubuntu-24.04 timeout-minutes: 10 permissions: contents: write steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v3 with: name: orbit-linux-x86_64 path: dist/ - name: Publish rolling release env: GITEA_TOKEN: ${{ github.token }} run: | (cd dist && sha256sum -c SHA256SUMS) python3 scripts/publish-rolling.py