From 52c918588cc86f9df5752131b0e9ae3f44cc02bd Mon Sep 17 00:00:00 2001 From: Tobias Persson Date: Tue, 28 Nov 2023 15:06:03 +0100 Subject: [PATCH] Add a manually triggered workflow that updates release This workflow will check out all ETOS components that are defined in the release manifest, get their latest release tag and update the manifest with these tags. It is running manually for now, but we may want to update it to be running automatically in the future. --- .github/workflows/update-release.yml | 83 ++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/update-release.yml diff --git a/.github/workflows/update-release.yml b/.github/workflows/update-release.yml new file mode 100644 index 00000000..e06b0f04 --- /dev/null +++ b/.github/workflows/update-release.yml @@ -0,0 +1,83 @@ +name: Update release versions +on: + workflow_dispatch: +jobs: + suiteRunner: + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v4 + with: + repository: eiffel-community/etos-suite-runner + - name: Get version + id: getVersion + run: | + VERSION=$(gh release view --json tagName --jq .tagName) + echo "version=$VERSION" >> $GITHUB_OUTPUT + outputs: + version: ${{ steps.getVersion.outputs.version }} + environmentProvider: + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v4 + with: + repository: eiffel-community/etos-environment-provider + - name: Get version + id: getVersion + run: | + VERSION=$(gh release view --json tagName --jq .tagName) + echo "version=$VERSION" >> $GITHUB_OUTPUT + outputs: + version: ${{ steps.getVersion.outputs.version }} + suiteStarter: + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v4 + with: + repository: eiffel-community/etos-suite-starter + - name: Get version + id: getVersion + run: | + VERSION=$(gh release view --json tagName --jq .tagName) + echo "version=$VERSION" >> $GITHUB_OUTPUT + outputs: + version: ${{ steps.getVersion.outputs.version }} + api: + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v4 + with: + repository: eiffel-community/etos-api + - name: Get version + id: getVersion + run: | + VERSION=$(gh release view --json tagName --jq .tagName) + echo "version=$VERSION" >> $GITHUB_OUTPUT + outputs: + version: ${{ steps.getVersion.outputs.version }} + update_manifest: + runs-on: ubuntu-latest + needs: [suiteRunner, environmentProvider, suiteStarter, api] + steps: + - uses: actions/checkout@v4 + - name: Update manifests + uses: fjogeleit/yaml-update-action@main + with: + branch: main + commitChange: true + valueFile: manifests/release/kustomization.yaml + message: Updating release images + changes: | + { + "resources[0]": "github.com/eiffel-community/etos-suite-runner//manifests/base?ref=${{ needs.suiteRunner.outputs.version }}", + "resources[1]": "github.com/eiffel-community/etos-environment-provider//manifests/base?ref=${{ needs.environmentProvider.outputs.version }}", + "resources[2]": "github.com/eiffel-community/etos-suite-starter//manifests/base?ref=${{ needs.suiteStarter.outputs.version }}", + "resources[3]": "github.com/eiffel-community/etos-api//manifests/base?ref=${{ needs.api.outputs.version }}" + }