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
Binary file removed .DS_Store
Binary file not shown.
44 changes: 44 additions & 0 deletions .github/workflows/bcr-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See https://github.com/bazel-contrib/publish-to-bcr
name: Publish to BCR

on:
# Allow the publish workflow to be called from another workflow.
# In this case, we trigger it from the release.yaml workflow.
workflow_call:
inputs:
release_version:
required: true
type: string
secrets:
BCR_PUBLISH_TOKEN:
required: true
# In case of problems, let release engineers retry by manually dispatching
# the workflow from the GitHub UI.
workflow_dispatch:
inputs:
release_version:
required: true
type: string
description: Release version to publish to the Bazel Central Registry
templates_ref:
default: ''
type: string
description: Override the ref to read .bcr templates from
jobs:
publish:
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v1.1.0
with:
attest: false
tag_name: ${{ inputs.release_version }}
author_name: aignas
author_email: 240938+aignas@users.noreply.github.com
# Tags don't include a "v" prefix
tag_prefix: ""
# GitHub repository which is a fork of the upstream where the Pull Request will be opened.
registry_fork: aignas/bazel-central-registry
templates_ref: ${{ inputs.templates_ref || inputs.release_version }}
draft: false
permissions:
contents: write
secrets:
publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }}
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: Release

on: # yamllint disable rule:truthy
push:
branches:
- main
tags:
- "*.*.*"

jobs:
pkg:
runs-on: ubuntu-latest

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

- name: Create release archive and notes
# Set by GH actions, see
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
run: ./ci/package.sh "${{ github.ref_name }}"

- name: Archive release artifacts
uses: actions/upload-artifact@v5
with:
name: release
path: release/*
retention-days: 5

release:
runs-on: ubuntu-latest
permissions:
contents: write
needs: pkg
steps:
- name: Download release artifacts
uses: actions/download-artifact@v6
with:
name: release

- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
body_path: release_notes.md
fail_on_unmatched_files: true
files: rules_shellcheck-*.tar.gz

bcr-publish:
needs: [release]
permissions:
contents: write
uses: ./.github/workflows/bcr-publish.yml
with:
release_version: ${{ needs.release.outputs.release_version }}
secrets:
BCR_PUBLISH_TOKEN: ${{ secrets.BCR_PUBLISH_TOKEN }}
39 changes: 10 additions & 29 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ on: # yamllint disable rule:truthy

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
- os: ubuntu-latest

steps:
- uses: actions/checkout@v5
Expand All @@ -24,20 +29,15 @@ jobs:
- name: Test
run: bazel test //...

test-mac:
runs-on: macos-latest

steps:
- uses: actions/checkout@v5

- name: Test
run: bazel test //...
- name: Create release archive and notes
# Set by GH actions, see
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
run: ./ci/package.sh "${{ github.ref_name }}"

pkg:
runs-on: ubuntu-latest
needs:
- build
- test-mac

steps:
- name: Checkout
Expand All @@ -54,22 +54,3 @@ jobs:
name: release
path: release/*
retention-days: 5

release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: pkg
steps:
- name: Download release artifacts
uses: actions/download-artifact@v6
with:
name: release

- name: Release
uses: softprops/action-gh-release@v2
with:
# Use GH feature to populate the changelog automatically
generate_release_notes: true
body_path: release_notes.md
fail_on_unmatched_files: true
files: rules_shellcheck-*.tar.gz
2 changes: 2 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ filegroup(
name = "distribution",
srcs = [
"BUILD.bazel",
"def.bzl",
"deps.bzl",
"CHANGELOG.md",
"LICENSE",
"MODULE.bazel",
Expand Down
2 changes: 1 addition & 1 deletion tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load(":test.bzl", shellcheck_test = "shellcheck_internal_test")
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
load(":test.bzl", shellcheck_test = "shellcheck_internal_test")

shellcheck_test(
name = "fail_test",
Expand Down