mirror of
https://ghproxy.com/https://github.com/truecharts/charts.git
synced 2026-07-21 03:10:25 +08:00
test new versioned release system
This commit is contained in:
66
.github/workflows/apps.release.yaml
vendored
Normal file
66
.github/workflows/apps.release.yaml
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
name: "Apps: Release"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
tags-ignore:
|
||||
- '**'
|
||||
paths:
|
||||
- 'test/**'
|
||||
- '.github/workflows/apps.release.yaml'
|
||||
|
||||
jobs:
|
||||
common-release:
|
||||
needs: pre-release
|
||||
runs-on: ubuntu-latest
|
||||
if: needs.pre-release.outputs.release == 'true'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.BOT_TOKEN }}
|
||||
path: master
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
repository: truecharts/catalog
|
||||
token: ${{ secrets.BOT_TOKEN }}
|
||||
path: catalog
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config user.name "TrueCharts-Bot"
|
||||
git config user.email "bot@truecharts.org"
|
||||
- name: Remove if release already exists
|
||||
run: |
|
||||
for chart in master/test/*; do
|
||||
if [ -d "${chart}" ]; then
|
||||
maxchartversion=$(cat ${chart}/Chart.yaml | grep "^version: " | awk -F" " '{ print $2 }')
|
||||
chartname=$(basename ${chart})
|
||||
echo "Processing... cleanup-existing... Chart: ${chartname} - Version: ${maxchartversion}"
|
||||
|
||||
rm -Rf catalog/test/${chartname}/${maxchartversion} || echo "Chart release ${chartname} with version ${maxchartversion} does not exist yet... Skipping..."
|
||||
rm -Rf catalog/test/${chartname}/item.yaml || echo "No old catalog item.yaml found for ${chartname}"
|
||||
fi
|
||||
done
|
||||
- name: Add Chart release
|
||||
run: |
|
||||
for chart in master/test/*; do
|
||||
if [ -d "${chart}" ]; then
|
||||
maxchartversion=$(cat ${chart}/Chart.yaml | grep "^version: " | awk -F" " '{ print $2 }')
|
||||
chartname=$(basename ${chart})
|
||||
echo "Processing... Copying charts... Chart: ${chartname} - Version: ${maxchartversion}"
|
||||
|
||||
mkdir -p catalog/test/${chartname}/${maxchartversion}
|
||||
cp -Rf ${chart}/* catalog/test/${chartname}/${maxchartversion}/
|
||||
mv catalog/test/${chartname}/${maxchartversion}/item.yaml catalog/test/${chartname}/
|
||||
fi
|
||||
done
|
||||
- name: Commit and Push new App releases
|
||||
run: |
|
||||
cd catalog
|
||||
git add --all
|
||||
git commit -sm "Commit new App releases for TrueCharts" || exit 0
|
||||
git push
|
||||
Reference in New Issue
Block a user