Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): tidier wf organization #4574

Merged
merged 5 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions .github/actions/automatic-updates/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ runs:
with:
token: ${{ inputs.secretGithubToken }}
release_branch: ${{ inputs.branch-ref }}

# Changelog
- name: Commit changelog
shell: bash
env:
Expand All @@ -48,15 +50,19 @@ runs:
run: |
git config --local user.email "$CI_EMAIL"
git config --local user.name "$CI_USER"
git add CHANGELOG.md && git commit -m 'chore: changelog automatic update' && echo "changelog=1" >> $GITHUB_ENV || echo "No changes to CHANGELOG"
git add CHANGELOG.md && git commit -m 'chore: changelog automatic update' && echo "changelog=1" >> $GITHUB_ENV || echo "No changes to changelog"

# Autogenerated
- name: Run refresh actions and commit
shell: bash
env:
CI_USER: "github-actions[bot]"
CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
run: |
make update-default-camel generate codegen update-docs
git add -A && git commit -m 'chore: nightly resource refresh' && echo "refresh=1" >> $GITHUB_ENV || echo "No changes to make update-docs"
git add -A && git commit -m 'chore: autogenerated project resource update' && echo "autogenerated=1" >> $GITHUB_ENV || echo "No changes to autogenerated project resources"

# SBOM
- name: Generate SBOM
uses: ./.github/actions/gh-go-mod-generate-sbom
with:
Expand All @@ -68,10 +74,33 @@ runs:
CI_USER: "github-actions[bot]"
CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
run: |
git add camel-k-sbom/camel-k-sbom.json && git commit -m 'chore: nightly SBOM refresh' && echo "sbom=1" >> $GITHUB_ENV || echo "No changes to SBOM"
git add camel-k-sbom/camel-k-sbom.json && git commit -m 'chore: nightly SBOM update' && echo "sbom=1" >> $GITHUB_ENV || echo "No changes to SBOM"

# Coverage badge
- name: Go Coverage Badge
uses: ./.github/actions/coverage-badge
with:
filename: coverage.out
target: badge.out
- name: Convert Badge to adoc
run: |
replacement=$(grep -o 'https://[^)]*' badge.out)
target="(?:https:\/\/img\.shields\.io\/badge\/Coverage).*?(?=\.svg)"
perl -i -pe "s|${target}|${replacement}|g" README.adoc
- name: Commit changes
shell: bash
env:
CI_USER: "github-actions[bot]"
CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
run: |
git config --local user.email "$CI_EMAIL"
git config --local user.name "$CI_USER"
git add -A && git commit -m 'chore: nightly coverage badge update' && echo "badge=1" >> $GITHUB_ENV || echo "No changes to coverage badge"

# Git push
- name: Push changes
shell: bash
if: env.changelog == 1 || env.refresh == 1 || env.sbom == 1
if: env.changelog == 1 || env.autogenerated == 1 || env.sbom == 1 || env.badge == 1
env:
CI_USER: "github-actions[bot]"
CI_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
Expand Down
1 change: 0 additions & 1 deletion .github/actions/backport
Submodule backport deleted from 2d7713
38 changes: 0 additions & 38 deletions .github/workflows/backport.yml

This file was deleted.

File renamed without changes.
47 changes: 9 additions & 38 deletions .github/workflows/nightly-automatic-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,54 +23,25 @@ on:
workflow_dispatch:

jobs:
main:
auto-updates:
strategy:
fail-fast: false
matrix:
ref-branch: [main, release-1.12.x, release-1.10.x]

if: github.repository == 'apache/camel-k'
runs-on: ubuntu-latest
name: Automatic updates on main branch
name: Automatic updates on ${{ matrix.ref-branch }} branch
steps:
- name: "Checkout code"
uses: actions/checkout@v3
with:
ref: main
ref: ${{ matrix.ref-branch }}
persist-credentials: false
submodules: recursive
- name: Automatic updates on main
uses: ./.github/actions/automatic-updates
with:
branch-ref: "main"
secretGithubToken: ${{ secrets.GITHUB_TOKEN }}
goVersion: "1.18.x"

v1_12_x:
if: github.repository == 'apache/camel-k'
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v2
with:
ref: release-1.12.x
persist-credentials: false
submodules: recursive
- name: Automatic updates on release-1.12.x branch
uses: ./.github/actions/automatic-updates
with:
branch-ref: "release-1.12.x"
branch-ref: ${{ matrix.ref-branch }}
secretGithubToken: ${{ secrets.GITHUB_TOKEN }}
goVersion: "1.18.x"

v1_10_x:
if: github.repository == 'apache/camel-k'
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v3
with:
ref: release-1.10.x
persist-credentials: false
submodules: recursive
- name: Automatic updates on release-1.10.x branch
uses: ./.github/actions/automatic-updates
with:
branch-ref: "release-1.10.x"
secretGithubToken: ${{ secrets.GITHUB_TOKEN }}
goVersion: "1.17.x"
87 changes: 0 additions & 87 deletions .github/workflows/nightly-coverage.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/nightly-native-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ on:

jobs:
native:
if: github.repository == 'apache/camel-k'
runs-on: macos-12

strategy:
fail-fast: false
matrix:
ref-branch: [main, release-1.12.x]
ref-branch: [main, release-1.12.x, release-1.10.x]

if: github.repository == 'apache/camel-k'
runs-on: macos-12
steps:
- name: "Checkout code"
uses: actions/checkout@v3
Expand Down
56 changes: 9 additions & 47 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,66 +31,28 @@ on:
workflow_dispatch:

jobs:
main:
if: github.repository == 'apache/camel-k'
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v3
with:
ref: main
persist-credentials: false
submodules: recursive
- name: Release main nightly
uses: ./.github/actions/release-nightly
with:
goVersion: "1.18.x"
javaVersion: "11"
secretE2ECluster: ${{ secrets.E2E_CLUSTER_CONFIG }}
secretE2EKube: ${{ secrets.E2E_KUBE_CONFIG }}
secretDockerHubUser: ${{ secrets.TEST_DOCKER_HUB_USERNAME }}
secretDockerHubPassword: ${{ secrets.TEST_DOCKER_HUB_PASSWORD }}
secretGithubToken: ${{ secrets.GITHUB_TOKEN }}

v1_12_x:
if: github.repository == 'apache/camel-k'
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v2
with:
ref: release-1.12.x
persist-credentials: false
submodules: recursive
- name: release-1.12.x nightly
uses: ./.github/actions/release-nightly
with:
goVersion: "1.18.x"
javaVersion: "11"
secretE2ECluster: ${{ secrets.E2E_CLUSTER_CONFIG }}
secretE2EKube: ${{ secrets.E2E_KUBE_CONFIG }}
secretDockerHubUser: ${{ secrets.TEST_DOCKER_HUB_USERNAME }}
secretDockerHubPassword: ${{ secrets.TEST_DOCKER_HUB_PASSWORD }}
secretGithubToken: ${{ secrets.GITHUB_TOKEN }}
release:
strategy:
fail-fast: false
matrix:
ref-branch: [main, release-1.12.x, release-1.10.x]

v1_10_x:
if: github.repository == 'apache/camel-k'
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v3
with:
ref: release-1.10.x
ref: ${{ matrix.ref-branch }}
persist-credentials: false
submodules: recursive
- name: release-1.10.x nightly
- name: Release nightly ${{ matrix.ref-branch }} branch
uses: ./.github/actions/release-nightly
with:
goVersion: "1.17.x"
javaVersion: "11"
goVersion: "1.18.x"
javaVersion: "17"
secretE2ECluster: ${{ secrets.E2E_CLUSTER_CONFIG }}
secretE2EKube: ${{ secrets.E2E_KUBE_CONFIG }}
secretDockerHubUser: ${{ secrets.TEST_DOCKER_HUB_USERNAME }}
secretDockerHubPassword: ${{ secrets.TEST_DOCKER_HUB_PASSWORD }}
secretGithubToken: ${{ secrets.GITHUB_TOKEN }}

3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule ".github/actions/backport"]
path = .github/actions/backport
url = https://github.com/tibdex/backport
[submodule ".github/actions/changelog"]
path = .github/actions/changelog
url = https://github.com/CharMixer/auto-changelog-action
Expand Down