argocd-applications/.forgejo/workflows/multi-semantic-release.yaml

51 lines
1.9 KiB
YAML
Raw Normal View History

name: multi-semantic-release
# This monorepo only tags releases from the main branch
on:
push:
branches:
- 'main'
jobs:
multi-semantic-release:
runs-on: docker
container:
image: forgejo.mixinet.net/oci/multi-semantic-release:latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Generate multi-semantic-release configuration
shell: sh
run: |
# Get the list of kustomize applications to work with (the folders that have a kustomization.yaml file)
applications="$(for app in */kustomization.yaml; do dirname "$app"; done)"
# Generate a values.yaml file for the main packages.json file
package_json_values_yaml=".package.json-values.yaml"
echo "applications:" >"$package_json_values_yaml"
for app in $applications; do
echo " - $app" >>"$package_json_values_yaml";
done
echo "::group::Generated values.yaml for the project"
cat "$package_json_values_yaml"
echo "::endgroup::"
# Generate the package.json file validating that is a good json file with jq
tmpl -f "$package_json_values_yaml" ".forgejo/package.json.tmpl" | jq . > "package.json"
echo "::group::Generated package.json for the project"
cat "package.json"
echo "::endgroup::"
# Remove the temporary values file
rm -f "$package_json_values_yaml"
# Generate the package.json file for each image
for app in $applications; do
tmpl -v "app_name=$app" -v "app_path=$app" ".forgejo/ws-package.json.tmpl" | jq . > "$app/package.json"
echo "::group::Generated package.json for the '$app' application"
cat "$app/package.json"
echo "::endgroup::"
done
- name: Run multi-semantic-release
shell: sh
run: |
multi-semantic-release | tee .multi-semantic-release.log