Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add workflow that builds and releases cache on new tags #42984

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
35 changes: 35 additions & 0 deletions .github/workflows/release_cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow builds and releases the rosdistro cache on a tag push.
---
name: release-cache

on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
tags:
- '**' # Double ** needed to match tags containing '/'

jobs:
build-and-release-cache:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Environmental variables
run: |
ROSDISTRO_TAG=${{ github.ref_name }}
echo "ROSDISTRO_TAG=${ROSDISTRO_TAG}" >> $GITHUB_ENV
echo "ROSDISTRO_TARGET=${ROSDISTRO_TAG%%/*}" >> $GITHUB_ENV
echo "ROSDISTRO_RELEASE=${ROSDISTRO_TAG#*/}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: pip install rosdistro
- run: |
rosdistro_build_cache --debug "${GITHUB_WORKSPACE}/index-v4.yaml" "${ROSDISTRO_TARGET}"
mv "${ROSDISTRO_TARGET}-cache.yaml.gz" "${ROSDISTRO_TARGET}-${ROSDISTRO_RELEASE}-cache.yaml.gz"
- name: Release
uses: softprops/action-gh-release@v2
with:
body: "Generated cache for ${{ env.ROSDISTRO_TAG }}"
tag_name: "${{ env.ROSDISTRO_TAG }}"
files: "${{ env.ROSDISTRO_TARGET }}-${{ env.ROSDISTRO_RELEASE }}-cache.yaml.gz"
generate_release_notes: false
Loading