Bump to 0.3.0 #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 | |
| on: | |
| push: | |
| tags: | |
| - v** | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| version-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Verify version matches tag | |
| if: github.ref_type == 'tag' | |
| run: | | |
| version=$(grep -oP "VERSION\s*=\s*'\\K[^']+" lib/restate/version.rb) | |
| tag_version=${{ github.ref_name }} | |
| tag_version=${tag_version#v} | |
| if [ "${tag_version}" != "${version}" ]; then | |
| echo "::error::version.rb version '${version}' != tag version '${tag_version}'. Please align them." | |
| exit 1 | |
| fi | |
| cargo_version=$(grep -oP '^version\s*=\s*"\K[^"]+' ext/restate_internal/Cargo.toml) | |
| if [ "${tag_version}" != "${cargo_version}" ]; then | |
| echo "::error::Cargo.toml version '${cargo_version}' != tag version '${tag_version}'. Please align them." | |
| exit 1 | |
| fi | |
| ci: | |
| runs-on: ubuntu-latest | |
| name: Build, lint, typecheck & test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.3" | |
| bundler-cache: true | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: ext/restate_internal | |
| - name: Verify | |
| run: make verify | |
| integration: | |
| uses: ./.github/workflows/integration.yaml | |
| permissions: | |
| contents: read | |
| issues: read | |
| checks: write | |
| pull-requests: write | |
| actions: read | |
| ci-data: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| result: ${{ steps.fetch.outputs.result }} | |
| steps: | |
| - id: fetch | |
| uses: oxidize-rb/actions/fetch-ci-data@v1 | |
| with: | |
| supported-ruby-platforms: | | |
| exclude: | |
| - arm-linux | |
| - x64-mingw32 | |
| - x64-mingw-ucrt | |
| - aarch64-mingw-ucrt | |
| native-gem: | |
| name: Build native gem (${{ matrix.ruby-platform }}) | |
| runs-on: ubuntu-latest | |
| needs: [version-check, ci, integration, ci-data] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby-platform: ${{ fromJSON(needs.ci-data.outputs.result).supported-ruby-platforms }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oxidize-rb/actions/setup-ruby-and-rust@v1 | |
| with: | |
| ruby-version: "3.3" | |
| bundler-cache: true | |
| cargo-cache: true | |
| cache-version: v1 | |
| - name: Cross-compile gem | |
| run: bundle exec rb-sys-dock --platform ${{ matrix.ruby-platform }} --ruby-versions "${{ join(fromJSON(needs.ci-data.outputs.result).stable-ruby-versions, ',') }}" --mount-toolchains --build | |
| - name: Upload gem | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gem-${{ matrix.ruby-platform }} | |
| path: pkg/*-${{ matrix.ruby-platform }}.gem | |
| if-no-files-found: error | |
| source-gem: | |
| runs-on: ubuntu-latest | |
| needs: [version-check, ci, integration] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.3" | |
| - name: Build source gem | |
| run: gem build restate-sdk.gemspec | |
| - name: Upload gem | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gem-source | |
| path: "*.gem" | |
| if-no-files-found: error | |
| release: | |
| name: Publish to RubyGems | |
| if: github.ref_type == 'tag' | |
| runs-on: ubuntu-latest | |
| needs: [native-gem, source-gem] | |
| environment: rubygems | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: gem-* | |
| merge-multiple: true | |
| path: gems/ | |
| - name: List gems | |
| run: ls -la gems/ | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.3" | |
| - name: Publish to RubyGems | |
| env: | |
| GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
| run: | | |
| for gem in gems/*.gem; do | |
| echo "Publishing ${gem}..." | |
| gem push "${gem}" || true | |
| done |