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
36 changes: 23 additions & 13 deletions .github/workflows/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
load("@rules_abcue//cue:defs.bzl", "cue_export", "cue_instance")

write_source_files(
name = "yaml",
files = {
"ci_gen.yaml": ":ci",
},
)

buildifier(
name = "buildifier.check",
exclude_patterns = ["./.git/*"],
Expand All @@ -23,10 +16,27 @@ cue_instance(
ancestor = "//cue.mod",
)

cue_export(
name = "ci",
out = "yaml",
expression = "ci",
instance = ":workflows",
package = "workflows",
EXPR = [
"buildifier",
"ci",
"release",
]

[
cue_export(
name = n,
out = "yaml",
expression = n,
instance = ":workflows",
package = "workflows",
)
for n in EXPR
]

write_source_files(
name = "yaml",
files = {
n + "_gen.yaml": ":" + n
for n in EXPR
},
)
19 changes: 0 additions & 19 deletions .github/workflows/buildifier.yaml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/buildifier_gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Buildifier
"on":
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: null
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: buildifier
run: bazel run --enable_bzlmod //.github/workflows:buildifier.check
18 changes: 0 additions & 18 deletions .github/workflows/release.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/release_gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Release
"on":
push:
tags:
- v*.*.*
permissions:
contents: write
jobs:
release:
uses: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v6
with:
release_files: rules_abcue-*.tar.gz
35 changes: 35 additions & 0 deletions .github/workflows/workflows.cue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@ package workflows

import "encoding/json"

buildifier: {
name: "Buildifier"

// Controls when the action will run.
on: {
// Triggers the workflow on push or pull request events but only for the main branch
push: branches: ["main"]
pull_request: branches: ["main"]
// Allows you to run this workflow manually from the Actions tab
workflow_dispatch: null
}
jobs: check: {
"runs-on": "ubuntu-latest"
steps: [{
uses: "actions/checkout@v4"
}, {
name: "buildifier"
run: "bazel run --enable_bzlmod //.github/workflows:buildifier.check"
}]
}
}

ci: {
// Controls when the action will run.
on: {
Expand Down Expand Up @@ -35,3 +57,16 @@ ci: {
}
}
}

release: {
// Cut a release whenever a new tag is pushed to the repo.
// You should use an annotated tag, like `git tag -a v1.2.3`
// and put the release notes into the commit message for the tag.
name: "Release"
on: push: tags: ["v*.*.*"]
permissions: contents: "write"
jobs: release: {
uses: "bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v6"
with: release_files: "rules_abcue-*.tar.gz"
}
}
Loading