Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
run: |
rustup toolchain install "${{ needs.rust-version.outputs.version }}" --profile minimal --target x86_64-unknown-linux-musl --component llvm-tools-preview
rustup default "${{ needs.rust-version.outputs.version }}"
- name: Test release version validation
run: python3 -m unittest scripts/test_check_release_version.py
- name: Format, check, and test examples
run: ./scripts/test.py --operation validate

Expand Down
112 changes: 89 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,39 @@ jobs:
version=$(sed -n 's/^channel = "\(.*\)".*/\1/p' rust-toolchain.toml)
echo "version=$version" >> "$GITHUB_OUTPUT"

release-info:
name: Validate release request
runs-on: ubuntu-24.04
outputs:
release_version: ${{ steps.validate.outputs.release_version }}
docs_version: ${{ steps.validate.outputs.docs_version }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Validate release request
id: validate
uses: roc-lang/release-package/actions/validate-release@d2560ead9f724bfaabfbc8134b8895e120171064
with:
release_version: ${{ github.event_name == 'workflow_dispatch' && inputs.release_version || '' }}
dry_run: ${{ github.event_name != 'workflow_dispatch' }}
github_token: ${{ github.token }}

- name: Validate release branch
if: github.event_name == 'workflow_dispatch'
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
run: |
if [ "${GITHUB_REF_TYPE:-}" != "branch" ] || [ "$GITHUB_REF_NAME" != "$DEFAULT_BRANCH" ]; then
echo "Releases must be dispatched from the default branch: $DEFAULT_BRANCH" >&2
exit 1
fi

build-windows-host:
name: Build Windows x64 host
needs: rust-version
needs: [rust-version, release-info]
runs-on: windows-2025

steps:
Expand All @@ -44,6 +74,13 @@ jobs:
rustup toolchain install "${{ needs.rust-version.outputs.version }}" --profile minimal --target x86_64-pc-windows-msvc
rustup default "${{ needs.rust-version.outputs.version }}"

- name: Prepare Cargo package version
if: github.event_name == 'workflow_dispatch'
shell: bash
env:
RELEASE_VERSION: ${{ needs.release-info.outputs.release_version }}
run: python scripts/check_release_version.py "$RELEASE_VERSION" --update

- name: Build Windows host
shell: pwsh
run: python scripts/build.py
Expand All @@ -58,13 +95,13 @@ jobs:

build:
name: Build release bundle
needs: [rust-version, build-windows-host]
needs: [rust-version, release-info, build-windows-host]
# macOS cross-compiles the Apple and Linux musl hosts. Windows is built
# natively above because the Rust dependencies require the Windows SDK.
runs-on: macos-15
outputs:
release_version: ${{ steps.validate.outputs.release_version }}
docs_version: ${{ steps.validate.outputs.docs_version }}
release_version: ${{ needs.release-info.outputs.release_version }}
docs_version: ${{ needs.release-info.outputs.docs_version }}
test_matrix: ${{ steps.bundles.outputs.test_matrix }}

steps:
Expand Down Expand Up @@ -96,23 +133,11 @@ jobs:
name: windows-x64-host
path: platform/targets/x64win

- name: Validate release request
id: validate
uses: roc-lang/release-package/actions/validate-release@d2560ead9f724bfaabfbc8134b8895e120171064
with:
release_version: ${{ github.event_name == 'workflow_dispatch' && inputs.release_version || '' }}
dry_run: ${{ github.event_name != 'workflow_dispatch' }}
github_token: ${{ github.token }}

- name: Validate release branch
- name: Prepare Cargo package version
if: github.event_name == 'workflow_dispatch'
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
run: |
if [ "${GITHUB_REF_TYPE:-}" != "branch" ] || [ "$GITHUB_REF_NAME" != "$DEFAULT_BRANCH" ]; then
echo "Releases must be dispatched from the default branch: $DEFAULT_BRANCH" >&2
exit 1
fi
RELEASE_VERSION: ${{ needs.release-info.outputs.release_version }}
run: python3 scripts/check_release_version.py "$RELEASE_VERSION" --update

- name: Build platform for all targets
run: ./scripts/build.py --all
Expand All @@ -136,7 +161,7 @@ jobs:
- name: Check version bump
uses: roc-lang/release-package/actions/run-bump-check@d2560ead9f724bfaabfbc8134b8895e120171064
with:
release_version: ${{ steps.validate.outputs.release_version }}
release_version: ${{ needs.release-info.outputs.release_version }}
dry_run: ${{ github.event_name != 'workflow_dispatch' }}
bump_check: warn
bump_entrypoint: platform/main.roc
Expand Down Expand Up @@ -273,20 +298,53 @@ jobs:
publish-release:
name: Publish GitHub release
needs:
- rust-version
- build
- build-docs
- test-bundles
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
release_source_commit: ${{ steps.release-source.outputs.commit_sha || github.sha }}

steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Install Rust
run: |
rustup toolchain install "${{ needs.rust-version.outputs.version }}" --profile minimal
rustup default "${{ needs.rust-version.outputs.version }}"

- name: Prepare Cargo package version
env:
RELEASE_VERSION: ${{ needs.build.outputs.release_version }}
run: python3 scripts/check_release_version.py "$RELEASE_VERSION" --update

- name: Open release source follow-up PR
id: release-source
uses: roc-lang/release-package/actions/create-followup-pr@d2560ead9f724bfaabfbc8134b8895e120171064
with:
release_version: ${{ needs.build.outputs.release_version }}
paths: |
Cargo.toml
Cargo.lock
branch_prefix: release-followup
base_branch: ${{ github.event.repository.default_branch }}
commit_message: Update sources for ${{ needs.build.outputs.release_version }}
pr_title: Update sources for ${{ needs.build.outputs.release_version }}
pr_body: |
Release follow-up for ${{ needs.build.outputs.release_version }}.

Updates the Cargo package version to match the published platform release.
The published example URLs will be added after the release is available.
github_token: ${{ github.token }}

- name: Download release bundles
uses: actions/download-artifact@v8
with:
Expand All @@ -308,13 +366,15 @@ jobs:
uses: roc-lang/release-package/actions/make-release-notes@d2560ead9f724bfaabfbc8134b8895e120171064
with:
release_version: ${{ needs.build.outputs.release_version }}
target: ${{ steps.release-source.outputs.commit_sha || github.sha }}
docs_url: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ needs.build.outputs.docs_version }}/
github_token: ${{ github.token }}

- name: Publish release
uses: roc-lang/release-package/actions/publish-release@48ccc909bd8f6ba60feb1d33d8b6ac1dc1c7af36
with:
release_version: ${{ needs.build.outputs.release_version }}
target: ${{ steps.release-source.outputs.commit_sha || github.sha }}
additional_assets: docs.tar.gz
github_token: ${{ github.token }}

Expand All @@ -337,6 +397,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v7
with:
ref: ${{ needs.publish-release.outputs.release_source_commit }}
fetch-depth: 0

- name: Install Roc
uses: roc-lang/setup-roc@bd311e2fb815a3d2255f7ee14a922f0b736e020b
Expand Down Expand Up @@ -417,15 +480,18 @@ jobs:
with:
release_version: ${{ needs.build.outputs.release_version }}
paths: |
Cargo.toml
Cargo.lock
examples
branch_prefix: release-followup
base_branch: ${{ github.event.repository.default_branch }}
commit_message: Update examples for ${{ needs.build.outputs.release_version }}
pr_title: Update examples for ${{ needs.build.outputs.release_version }}
commit_message: Update sources for ${{ needs.build.outputs.release_version }}
pr_title: Update sources for ${{ needs.build.outputs.release_version }}
pr_body: |
Release follow-up for ${{ needs.build.outputs.release_version }}.

Updates checked-in examples to the published platform bundle.
Updates the Cargo package version and checked-in examples to match
the published platform release.
github_token: ${{ github.token }}

- name: Create Pages tree
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "roc_host"
version = "0.0.1"
version = "0.21.0-rc4"
authors = ["The Roc Contributors"]
edition = "2021"
rust-version = "1.83"
Expand Down
Loading
Loading