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
9 changes: 8 additions & 1 deletion .bcr/metadata.template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"homepage": "https://github.com/abcue/rules_abcue",
"maintainers": [],
"maintainers": [
{
"name": "Yujun Zhang",
"email": "zhangyujun@gmail.com",
"github": "yujunz",
"github_user_id": 6813397
}
],
"repository": ["github:abcue/rules_abcue"],
"versions": [],
"yanked_versions": {}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ cue_instance(
EXPR = [
"buildifier",
"ci",
"publish",
"release",
]

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci_gen.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: CI
"on":
push:
branches:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/publish_gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish
"on":
workflow_call:
inputs:
tag_name:
required: true
type: string
workflow_dispatch:
inputs:
tag_name:
required: true
type: string
jobs:
publish:
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v0.2.1
with:
tag_name: ${{ inputs.tag_name }}
registry_fork: abcue/bazel-central-registry
attest: true
permissions:
contents: write
id-token: write
attestations: write
secrets:
publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }}
47 changes: 43 additions & 4 deletions .github/workflows/workflows.cue
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package workflows

import "encoding/json"
import (
"strings"
"encoding/json"
)

buildifier: {
name: "Buildifier"
[N=_]: name: *strings.ToTitle(N) | _

buildifier: {
// Controls when the action will run.
on: {
// Triggers the workflow on push or pull request events but only for the main branch
Expand All @@ -25,6 +28,7 @@ buildifier: {
}

ci: {
name: "CI"
// Controls when the action will run.
on: {
// Triggers the workflow on push or pull request events but only for the main branch
Expand Down Expand Up @@ -58,11 +62,46 @@ ci: {
}
}

publish: {
on: {
// Run the publish workflow after a successful release
// Will be triggered from the release.yaml workflow
workflow_call: inputs: tag_name: {
required: true
type: "string"
}
// In case of problems, let release engineers retry by manually dispatching
// the workflow from the GitHub UI
workflow_dispatch: inputs: tag_name: {
required: true
type: "string"
}
}
jobs: publish: {
uses: "bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v0.2.1"
with: {
tag_name: "${{ inputs.tag_name }}"
// GitHub repository which is a fork of the upstream where the Pull Request will be opened.
registry_fork: "abcue/bazel-central-registry"
// see note on Attestation Support
attest: true
}
permissions: {
contents: "write"
// Necessary if attest:true
"id-token": "write"
// Necessary if attest:true
attestations: "write"
}
// Necessary to push to the BCR fork, and to open a pull request against a registry
secrets: publish_token: "${{ secrets.BCR_PUBLISH_TOKEN }}"
}
}

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: {
Expand Down
Loading