Skip to content

Package CI Template

A Wyn package is a git repo, so CI is ordinary git-repo CI: check, test, and format on every push and PR. There is no registry to publish to - a release is a git tag - so the release step just tags and pushes.

.github/workflows/ci.yml

yaml
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Wyn
        run: curl -fsSL https://wynlang.com/install.sh | sh

      - name: Restore dependencies
        run: |
          export PATH="$HOME/.wyn/bin:$PATH"
          [ -f wyn.toml ] && wyn restore || true

      - name: Check
        run: |
          export PATH="$HOME/.wyn/bin:$PATH"
          for f in src/*.wyn; do
            wyn check "$f" || exit 1
          done

      - name: Test
        run: |
          export PATH="$HOME/.wyn/bin:$PATH"
          for f in tests/*.wyn; do
            [ -f "$f" ] || continue
            wyn run "$f" || exit 1
          done

      - name: Format check
        run: |
          export PATH="$HOME/.wyn/bin:$PATH"
          for f in src/*.wyn; do
            wyn fmt "$f" --check || exit 1
          done

wyn restore needs its dependencies to clone without prompting. If your package depends on private repos, configure a non-interactive credential helper or an SSH deploy key in the job before wyn restore - see Creating Packages.

Releasing

There is no publish step. Cut a release by tagging a commit and pushing the tag:

sh
git tag v1.0.0
git push --tags

Consumers then pin it with wyn add github.com/you/[email protected].

If you want the tag push automated, add a release job that runs on tags:

yaml
  release:
    if: startsWith(github.ref, 'refs/tags/v')
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Create GitHub Release
        uses: softprops/action-gh-release@v2

Usage

  1. Copy the workflow file to your package repo.
  2. Ensure your package has src/ and tests/ directories.
  3. Push to GitHub - CI runs automatically.
  4. Tag vX.Y.Z when you're ready to release.

Package Structure

my-lib/
├── wyn.toml
├── src/
│   └── my-lib.wyn
├── tests/
│   └── test_my-lib.wyn
└── .github/
    └── workflows/
        └── ci.yml

See Also

MIT License - v1.20.0