forked from aspect-build/rules_ts
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (62 loc) · 2.66 KB
/
bcr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# GitHub Actions workflow to create a pull request to update the bazel central
# registry after a successful release.
#
# Usage:
# 1. Fork bazelbuild/bazel-central-registry to your org or personal account.
# 2. Set the workflow env variables below (see instructions for each variable).
# 3. Update the following files in .github/workflows/bcr to be relevant for your
# project:
# - presubmit.yml
# - metadata.template.json
# - source.template.json
# See https://docs.bazel.build/versions/main/bzlmod.html#bazel-central-registry
# for more information.
# 4. A PR will be posted from your fork to bazelbuild/bazel-central-registry
# with an updated module entry after a successful release.
name: BCR
on:
release:
types: [published]
env:
# Bazel central registry to post a pull request to.
BCR: bazelbuild/bazel-central-registry
# Fork of the bazel central registery to push the pull request branch to
BCR_FORK: aspect-build/bazel-central-registry
jobs:
bcr-pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: '14'
- name: Get the tag
id: get_tag
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
- name: Checkout this repo to access scripts
uses: actions/checkout@v3
- name: Checkout the released version of this repo
uses: actions/checkout@v3
with:
ref: ${{ env.GITHUB_REF }}
path: project
- name: Checkout bcr
uses: actions/checkout@v3
with:
repository: ${{ env.BCR }}
path: bcr
- name: Create bcr entry
run: node .github/workflows/create-bcr-entry.mjs project bcr $GITHUB_REPOSITORY ${{ steps.get_tag.outputs.TAG }}
- name: Create Pull Request
id: post_pr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.ASPECT_BCR_TOKEN }}
path: bcr
push-to-fork: ${{ env.BCR_FORK }}
commit-message: ${{ github.repository }}@${{ steps.get_tag.outputs.TAG }}
branch: ${{ github.repository }}@${{ steps.get_tag.outputs.TAG }}
title: ${{ github.repository }}@${{ steps.get_tag.outputs.TAG }}
body: |
[Automated] Publish ${{ github.repository }}@${{ steps.get_tag.outputs.TAG }}.
- name: Echo PR url
run: echo ${{ steps.post_pr.outputs.pull-request-url }}