Skip to content

Latest commit

 

History

History
71 lines (53 loc) · 1.5 KB

README.md

File metadata and controls

71 lines (53 loc) · 1.5 KB

Pkl GitHub Actions

Check out the PklDoc

GitHub Action in Pkl

.github/workflows/hello.pkl

amends "package://pkg.pkl-lang.org/github.com/jamesward/pklgha/[email protected]#/GitHubAction.pkl"

on {
  push {

  }
}

jobs {
  ["hello"] = new {
    `runs-on` = "ubuntu-latest"

    steps {
      new {
        name = "checkout"
        uses = "actions/checkout@v4"
      }
    }
  }
}

Generate the Yaml:

pkl eval -f yaml -o .github/workflows/hello.yaml .github/workflows/hello.pkl

Examples

Release a Pkl Package

  1. Enable publishing GitHub Pages from GitHub Actions via https:/<your org>/<your repo>/settings/pages
  2. Create .github/workflows/release.pkl
    amends "package://pkg.pkl-lang.org/github.com/jamesward/pklgha/[email protected]#/GitHubActionPkl.pkl"
    
    action = "release"
    
  3. Create the GitHub Action Yaml:
    pkl eval -f yaml -o .github/workflows/release.yaml .github/workflows/release.pkl
    

Developer Info

Update

pkl eval -f yaml -o .github/workflows/release.yaml .github/workflows/release.pkl

Release

  1. Update the version above
  2. Tag and push
    git tag [email protected]
    git push --atomic origin main [email protected]