Skip to content

2.4.1

2.4.1 #378

Workflow file for this run

name: Continuous Integration
concurrency: ci-${{ github.ref }}
on:
push:
tags-ignore:
- "*"
branches:
- "main"
pull_request:
release:
types: [published]
workflow_dispatch:
env:
OBS_USER: ${{ secrets.OBS_USER }}
OBS_PASS: ${{ secrets.OBS_PASS }}
OBS_PROJECT: ${{ secrets.OBS_PROJECT}}
jobs:
test-helm-charts:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: azure/[email protected]
with:
version: v3.4.0
- uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/[email protected]
- name: Lint
run: ct lint --config=ct.yaml --lint-conf=helmlintconf.yaml
create-artifact:
runs-on: ubuntu-20.04
needs: [test-helm-charts]
steps:
- uses: actions/checkout@v4
- name: compress
run: |
set -x
find ./charts/ -maxdepth 1 -mindepth 1 -exec sh -c 'tar -zcf $(basename {}).tgz -C charts/ ./$(basename {})/' \;
- uses: actions/upload-artifact@v4
with:
name: charts
path: |
*.tgz
release-rolling:
needs: [test-helm-charts, create-artifact]
if: (github.event_name == 'push' && github.ref == 'refs/heads/main')
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v4
with:
name: charts
- uses: "marvinpinto/[email protected]"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "rolling"
prerelease: true
title: "Cutting Edge"
files: |
trento-server.tgz
release:
runs-on: ubuntu-latest
needs: [test-helm-charts]
if: github.event.release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.7.2
- name: Add dependency chart repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NAME_TEMPLATE: "{{ .Version }}"
obs-commit-charts:
needs: [test-helm-charts]
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/main' || github.event_name == 'release'
container:
image: ghcr.io/trento-project/continuous-delivery:main
env:
DEST_FOLDER: "/tmp/osc_project"
FOLDER: packaging/suse
options: -u 0:0
strategy:
matrix:
charts: ["trento-server"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions-ecosystem/action-get-latest-tag@v1
id: latest-tag
with:
semver_only: true
initial_version: 0.0.1
- name: Configure OSC
# OSC credentials must be configured beforehand as the HOME variables cannot be changed from /github/home
# that is used to run osc commands
run: |
mkdir -p $HOME/.config/osc
cp /home/osc/.config/osc/oscrc $HOME/.config/osc
/scripts/init_osc_creds.sh
- name: Prepare .changes file
# The .changes file is updated only in release creation. This current task should be improved
# in order to add the current rolling release notes
if: github.event_name == 'release'
run: |
PACKAGE_NAME=${{ matrix.charts }}-helm
CHANGES_FILE=${{ matrix.charts }}.changes
CHART_FOLDER=$FOLDER/${{ matrix.charts }}
osc checkout $OBS_PROJECT $PACKAGE_NAME $CHANGES_FILE
mv $CHANGES_FILE $CHART_FOLDER
TAG=${{ steps.latest-tag.outputs.tag }}
./hack/gh_release_to_obs_changeset.py ${{ github.repository }} -a [email protected] -t $TAG -f $CHART_FOLDER/$CHANGES_FILE
- name: Commit on OBS
run: |
echo "Commiting ${{ matrix.charts }} for package ${{ matrix.charts }}-helm"
OBS_PACKAGE=$OBS_PROJECT/${{ matrix.charts }}-helm
osc checkout $OBS_PACKAGE -o $DEST_FOLDER
cp -r packaging/suse/${{ matrix.charts }}/* $DEST_FOLDER
cp -r charts/${{ matrix.charts }}/Chart.yaml $DEST_FOLDER
cd $DEST_FOLDER
make
osc ar
osc commit -m "GitHub Actions automated update to reference ${{ github.sha }}"