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
54 changes: 0 additions & 54 deletions .github/workflows/bundle.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/generate-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
- name: Check out the repository
uses: actions/checkout@v4

- uses: roc-lang/setup-roc@39c354a6a838a0089eea9068a0414f49b62c5c08
- uses: roc-lang/setup-roc@bd311e2fb815a3d2255f7ee14a922f0b736e020b
with:
# Note: nightly hashes are not verified because they are updated regularly.
version: nightly
version: nightly-new-compiler

- run: roc version

Expand All @@ -40,4 +40,4 @@ jobs:
path: generated-docs

- name: Deploy docs
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4
154 changes: 154 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: Release

on:
workflow_dispatch:
inputs:
release_tag:
description: "Release tag, e.g. v0.1.0"
required: true
type: string
pull_request:

env:
ZIG_VERSION: "0.16.0"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# Do not add permissions here. Configure them at the job level.
permissions: {}

jobs:
build-bundle:
name: Build package bundle
runs-on: ubuntu-24.04
outputs:
bundle_filename: ${{ steps.bundle.outputs.bundle_filename }}
defaults:
run:
shell: bash

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Zig
uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # 2.2.1
with:
version: ${{ env.ZIG_VERSION }}
use-cache: false

- name: Install Roc
uses: roc-lang/setup-roc@bd311e2fb815a3d2255f7ee14a922f0b736e020b
with:
# Installs the latest nightly from https://github.com/roc-lang/nightlies
version: nightly-new-compiler

- name: Run checks
run: ROC=roc ./ci/all_tests.sh

- name: Bundle package
id: bundle
run: |
bundle_output=$(scripts/bundle.sh --output-dir dist 2>&1)
echo "$bundle_output"

bundle_path=$(echo "$bundle_output" | awk '/^Created:/ { print $2; exit }')
if [[ -z "$bundle_path" || ! -f "$bundle_path" ]]; then
echo "Error: could not find bundle path from roc bundle output"
exit 1
fi

bundle_filename=$(basename "$bundle_path")
echo "bundle_filename=$bundle_filename" >> "$GITHUB_OUTPUT"

- name: Upload package bundle artifact
uses: actions/upload-artifact@v4
with:
name: package-bundle
path: dist/${{ steps.bundle.outputs.bundle_filename }}
retention-days: 30

test-bundle:
name: Test package bundle (${{ matrix.os }})
needs: build-bundle
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- macos-15-intel
- windows-2025
defaults:
run:
shell: bash

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Zig
uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # 2.2.1
with:
version: ${{ env.ZIG_VERSION }}
use-cache: false

- name: Install Roc
uses: roc-lang/setup-roc@bd311e2fb815a3d2255f7ee14a922f0b736e020b
with:
# Installs the latest nightly from https://github.com/roc-lang/nightlies
version: nightly-new-compiler

- name: Download package bundle artifact
uses: actions/download-artifact@v4
with:
name: package-bundle
path: dist

- name: Test examples against downloaded bundle
run: python3 ci/test_bundle_examples.py --bundle-path "dist/${{ needs.build-bundle.outputs.bundle_filename }}"

create-release:
name: Create GitHub release
needs:
- build-bundle
- test-bundle
runs-on: ubuntu-24.04
if: github.event_name == 'workflow_dispatch'
permissions:
contents: write
defaults:
run:
shell: bash

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download package bundle artifact
uses: actions/download-artifact@v4
with:
name: package-bundle
path: dist

- name: Install Roc
uses: roc-lang/setup-roc@bd311e2fb815a3d2255f7ee14a922f0b736e020b
with:
# Installs the latest nightly from https://github.com/roc-lang/nightlies
version: nightly-new-compiler

- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
bundle_file="dist/${{ needs.build-bundle.outputs.bundle_filename }}"
roc_version=$(roc version)

gh release create "${{ github.event.inputs.release_tag }}" \
"$bundle_file" \
--target "$GITHUB_SHA" \
--title "${{ github.event.inputs.release_tag }}" \
--generate-notes \
--notes "Unicode package bundle built with Roc $roc_version."
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

# Ignore the example binaries
/get-visual-width
/nr-of-code-points
/split-graphemes
examples/get-visual-width
examples/nr-of-code-points
examples/split-graphemes
Expand All @@ -10,3 +13,8 @@ package/InternalGBPGen
package/GraphemeTestGen
package/InternalEmojiGen
package/InternalEAWGen

# Ignore release workflow scratch files
dist/
__pycache__/
.roc-unicode-tmp/
Loading
Loading