• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2023 The Bazel Authors. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# Cut a release whenever a new tag is pushed to the repo.
16name: Release
17
18on:
19  push:
20    tags:
21      - "v*.*.*"
22jobs:
23  build:
24    runs-on: ubuntu-latest
25    steps:
26      - name: Checkout
27        uses: actions/checkout@v3
28      - name: Mount bazel caches
29        uses: actions/cache@v3
30        with:
31          path: |
32            ~/.cache/bazel
33            ~/.cache/bazel-repo
34          key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }}
35          restore-keys: bazel-cache-
36      # Skipping tests for now to test the release workflow
37      # - name: bazel test //...
38      #   env:
39      #     # Bazelisk will download bazel to here
40      #     XDG_CACHE_HOME: ~/.cache/bazel-repo
41      #   run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test --keep_going //...
42      - name: Prepare workspace snippet
43        run: .github/workflows/workspace_snippet.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt
44      - name: Release
45        uses: softprops/action-gh-release@v1
46        with:
47          # Use GH feature to populate the changelog automatically
48          generate_release_notes: true
49          body_path: release_notes.txt
50          fail_on_unmatched_files: true
51          files: rules_testing-*.tar.gz
52