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 4 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/release_cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow builds and releases the rosdistro cache on a tag push.
---
name: release-cache

on:

Check warning on line 5 in .github/workflows/release_cache.yaml

View workflow job for this annotation

GitHub Actions / Yaml Linting (3.8)

5:1 [truthy] truthy value should be one of [false, true]
oysstu marked this conversation as resolved.
Show resolved Hide resolved
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