• 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      - "*.*.*"
22
23jobs:
24  build:
25    runs-on: ubuntu-latest
26    steps:
27      - name: Checkout
28        uses: actions/checkout@v4
29      - name: Create release archive and notes
30        run: .github/workflows/create_archive_and_notes.sh
31      - name: Publish wheel dist
32        env:
33          # This special value tells pypi that the user identity is supplied within the token
34          TWINE_USERNAME: __token__
35          # Note, the PYPI_API_TOKEN is for the rules-python pypi user, added by @rickylev on
36          # https://github.com/bazelbuild/rules_python/settings/secrets/actions
37          TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
38        run: bazel run --stamp --embed_label=${{ github.ref_name }} //python/runfiles:wheel.publish
39      - name: Release
40        uses: softprops/action-gh-release@v2
41        with:
42          # Use GH feature to populate the changelog automatically
43          generate_release_notes: true
44          body_path: release_notes.txt
45          prerelease: ${{ contains(github.ref, '-rc') }}
46          fail_on_unmatched_files: true
47          files: rules_python-*.tar.gz
48