-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: reformat workflow yaml files (#578)
- Loading branch information
1 parent
f9574c8
commit 784bf0d
Showing
5 changed files
with
66 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,56 +38,46 @@ jobs: | |
pull-requests: write | ||
steps: | ||
- uses: actions/[email protected] | ||
- | ||
name: Create release branch | ||
- name: Create release branch | ||
run: git checkout -b release/${{ github.event.inputs.version }} | ||
- | ||
name: Update changelog | ||
- name: Update changelog | ||
uses: thomaseizinger/[email protected] | ||
with: | ||
tag: ${{ github.event.inputs.version }} | ||
- | ||
name: Initialize mandatory git config | ||
- name: Initialize mandatory git config | ||
run: | | ||
git config user.name "eclipse-tractusx-bot" | ||
git config user.email "[email protected]" | ||
- | ||
uses: ./.github/actions/setup-java | ||
- | ||
name: Bump version in gradle.properties | ||
- uses: ./.github/actions/setup-java | ||
- name: Bump version in gradle.properties | ||
run: |- | ||
# replace the project's (default) version, could be overwritten later with the -Pversion=... flag | ||
sed -i 's/version=.*/version=${{ github.event.inputs.version }}/g' gradle.properties | ||
# replace the project's (default) version, could be overwritten later with the -Pversion=... flag | ||
sed -i 's/version=.*/version=${{ github.event.inputs.version }}/g' gradle.properties | ||
env: | ||
GITHUB_PACKAGE_USERNAME: ${{ github.actor }} | ||
GITHUB_PACKAGE_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | ||
- | ||
name: Bump version in /charts | ||
- name: Bump version in /charts | ||
uses: mikefarah/[email protected] | ||
with: | ||
cmd: |- | ||
find charts -name Chart.yaml -maxdepth 3 | xargs -n1 yq -i '.appVersion = "${{ github.event.inputs.version }}" | .version = "${{ github.event.inputs.version }}"' | ||
- | ||
name: Update Chart READMEs | ||
- name: Update Chart READMEs | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: jnorwood/helm-docs:v1.10.0 | ||
options: -v ${{ github.workspace }}/charts:/helm-docs | ||
run: | | ||
helm-docs --log-level debug | ||
- | ||
name: Commit changelog and manifest files | ||
- name: Commit changelog and manifest files | ||
id: make-commit | ||
run: | | ||
git add CHANGELOG.md gradle.properties $(find charts -name Chart.yaml) $(find charts -name README.md) | ||
git commit --message "Prepare release ${{ github.event.inputs.version }}" | ||
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
- | ||
name: Push new branch | ||
- name: Push new branch | ||
run: git push origin release/${{ github.event.inputs.version }} | ||
- | ||
name: Create pull request | ||
- name: Create pull request | ||
uses: thomaseizinger/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,41 +41,35 @@ jobs: | |
helm-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
############## | ||
### Set-Up ### | ||
############## | ||
- | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: helm (setup) | ||
uses: azure/[email protected] | ||
with: | ||
version: v3.8.1 | ||
- | ||
name: python (setup) | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.7 | ||
- | ||
name: chart-testing (setup) | ||
uses: helm/[email protected] | ||
##################### | ||
### Chart Testing ### | ||
##################### | ||
- | ||
name: chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed --config ct.yaml --target-branch main) | ||
if [[ -n "$changed" ]]; then | ||
echo "changed=true" >> $GITHUB_OUTPUT | ||
fi | ||
- | ||
name: chart-testing (lint) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: | | ||
ct lint \ | ||
--config ct.yaml \ | ||
--all | ||
############## | ||
### Set-Up ### | ||
############## | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: helm (setup) | ||
uses: azure/[email protected] | ||
with: | ||
version: v3.8.1 | ||
- name: python (setup) | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.7 | ||
- name: chart-testing (setup) | ||
uses: helm/[email protected] | ||
##################### | ||
### Chart Testing ### | ||
##################### | ||
- name: chart-testing (list-changed) | ||
id: list-changed | ||
run: | | ||
changed=$(ct list-changed --config ct.yaml --target-branch main) | ||
if [[ -n "$changed" ]]; then | ||
echo "changed=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: chart-testing (lint) | ||
if: steps.list-changed.outputs.changed == 'true' | ||
run: | | ||
ct lint \ | ||
--config ct.yaml \ | ||
--all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,24 +36,21 @@ jobs: | |
outputs: | ||
RELEASE_VERSION: ${{ steps.release-version.outputs.RELEASE_VERSION }} | ||
steps: | ||
- | ||
name: Extract version from branch name (for release branches) | ||
- name: Extract version from branch name (for release branches) | ||
if: startsWith(github.event.pull_request.head.ref, 'release/') | ||
run: | | ||
BRANCH_NAME="${{ github.event.pull_request.head.ref }}" | ||
VERSION=${BRANCH_NAME#release/} | ||
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV | ||
- | ||
name: Extract version from branch name (for hotfix branches) | ||
- name: Extract version from branch name (for hotfix branches) | ||
if: startsWith(github.event.pull_request.head.ref, 'hotfix/') | ||
run: | | ||
BRANCH_NAME="${{ github.event.pull_request.head.ref }}" | ||
VERSION=${BRANCH_NAME#hotfix/} | ||
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV | ||
- | ||
name: Output release version | ||
- name: Output release version | ||
id: release-version | ||
run: | | ||
echo "RELEASE_VERSION=${{ env.RELEASE_VERSION }}" >> $GITHUB_OUTPUT | ||
|
@@ -102,12 +99,12 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
variant: [{dir: edc-controlplane, img: edc-runtime-memory}, | ||
{dir: edc-controlplane, img: edc-controlplane-memory-hashicorp-vault}, | ||
{dir: edc-controlplane, img: edc-controlplane-postgresql-hashicorp-vault}, | ||
{dir: edc-controlplane, img: edc-controlplane-postgresql-azure-vault}, | ||
{dir: edc-dataplane, img: edc-dataplane-azure-vault}, | ||
{dir: edc-dataplane, img: edc-dataplane-hashicorp-vault}] | ||
variant: [ { dir: edc-controlplane, img: edc-runtime-memory }, | ||
{ dir: edc-controlplane, img: edc-controlplane-memory-hashicorp-vault }, | ||
{ dir: edc-controlplane, img: edc-controlplane-postgresql-hashicorp-vault }, | ||
{ dir: edc-controlplane, img: edc-controlplane-postgresql-azure-vault }, | ||
{ dir: edc-dataplane, img: edc-dataplane-azure-vault }, | ||
{ dir: edc-dataplane, img: edc-dataplane-hashicorp-vault } ] | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
@@ -136,21 +133,17 @@ jobs: | |
|
||
if: github.event.pull_request.merged == true && needs.release-version.outputs.RELEASE_VERSION | ||
steps: | ||
- | ||
name: Export RELEASE_VERSION env | ||
- name: Export RELEASE_VERSION env | ||
run: | | ||
echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV | ||
- | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Install Helm | ||
- name: Install Helm | ||
uses: azure/[email protected] | ||
with: | ||
version: v3.8.1 | ||
- | ||
name: Package helm, update index.yaml and push to gh-pages | ||
- name: Package helm, update index.yaml and push to gh-pages | ||
run: | | ||
# Prepare git env | ||
git config user.name "eclipse-tractusx-bot" | ||
|
@@ -183,17 +176,14 @@ jobs: | |
pull-requests: write | ||
if: github.event.pull_request.merged == true && needs.release-version.outputs.RELEASE_VERSION | ||
steps: | ||
- | ||
name: Export RELEASE_VERSION env | ||
- name: Export RELEASE_VERSION env | ||
run: | | ||
echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV | ||
- | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
# 0 to fetch the full history due to upcoming merge of releases into main branch | ||
fetch-depth: 0 | ||
- | ||
name: Create Release Tag | ||
- name: Create Release Tag | ||
id: create_release_tag | ||
run: | | ||
# Prepare git env | ||
|
@@ -207,8 +197,7 @@ jobs: | |
# Create & push tag | ||
git tag --force ${{ env.RELEASE_VERSION }} | ||
git push --force origin ${{ env.RELEASE_VERSION }} | ||
- | ||
name: Create Github Release | ||
- name: Create Github Release | ||
id: create_release | ||
uses: thomaseizinger/[email protected] | ||
env: | ||
|
@@ -219,10 +208,8 @@ jobs: | |
name: ${{ env.RELEASE_VERSION }} | ||
draft: false | ||
prerelease: false | ||
- | ||
uses: ./.github/actions/setup-java | ||
- | ||
name: Merge releases back into main and set new snapshot version | ||
- uses: ./.github/actions/setup-java | ||
- name: Merge releases back into main and set new snapshot version | ||
if: github.event.pull_request.base.ref == 'releases' | ||
run: | | ||
# Prepare git env | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters