Auto Update to '2024.2.0' (#9) #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Module | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
publish_module: | |
name: "Publish Module" | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout repository | |
- uses: actions/checkout@v3 | |
with: | |
path: libraries/bzlmodrio-ni | |
- name: Create Archive | |
run: git archive HEAD --format=tar.gz --output="bzlmodrio-ni-${GITHUB_REF_NAME}.tar.gz" | |
working-directory: libraries/bzlmodrio-ni | |
- name: Setup archive name | |
run: echo "ARCHIVE_NAME=libraries/bzlmodrio-ni/bzlmodrio-ni-${GITHUB_REF_NAME}.tar.gz" >> "$GITHUB_ENV" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: "${{ env.ARCHIVE_NAME }}" | |
# Checkout gentool | |
- uses: actions/checkout@v3 | |
with: | |
repository: 'bzlmodRio/gentool.git' | |
fetch-depth: 0 | |
path: gentool | |
ref: refactor_dev | |
# Checkout BCR | |
- uses: actions/checkout@v3 | |
with: | |
repository: 'bzlmodRio/bazel-central-registry.git' | |
fetch-depth: 0 | |
path: bazel-central-registry | |
ref: bzlmodrio | |
# Run publishing | |
- run: bazel run //:publish | |
working-directory: libraries/bzlmodrio-ni/generate | |
- name: Store version | |
run: echo "NEW_VERSION=$(bazel run //:get_version)" >> $GITHUB_ENV | |
working-directory: libraries/bzlmodrio-ni/generate | |
# Create pull requests | |
- name: Create Gentool Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.AUTO_UPDATE_KEY }} | |
with: | |
path: gentool | |
base: refactor_dev | |
token: ${{ secrets.AUTO_UPDATE_KEY }} | |
reviewers: pjreiniger | |
branch: autoupdate/bzlmodrio-ni_update_${{ env.NEW_VERSION }} | |
title: "Auto Update bzlmodrio-ni module to '${{ env.NEW_VERSION }}'" | |
- name: Create BCR Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.AUTO_UPDATE_KEY }} | |
with: | |
path: bazel-central-registry | |
base: bzlmodrio | |
token: ${{ secrets.AUTO_UPDATE_KEY }} | |
reviewers: pjreiniger | |
branch: autoupdate/bzlmodrio-ni_update_${{ env.NEW_VERSION }} | |
title: "Auto Update latest bzlmodrio-ni to '${{ env.NEW_VERSION }}'" |