ci: update
This commit is contained in:
parent
0a14dfafd0
commit
0be7ca9089
1 changed files with 63 additions and 16 deletions
|
@ -6,6 +6,8 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- release/**
|
- release/**
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -18,7 +20,7 @@ env:
|
||||||
KUBECTL_VERSION: v1.21.0 # renovate: datasource=github-releases depName=kubectl packageName=kubernetes/kubernetes
|
KUBECTL_VERSION: v1.21.0 # renovate: datasource=github-releases depName=kubectl packageName=kubernetes/kubernetes
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
node-lint:
|
lint-node:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
- run: cat /etc/os-release
|
- run: cat /etc/os-release
|
||||||
|
@ -26,7 +28,9 @@ jobs:
|
||||||
- name: install deps
|
- name: install deps
|
||||||
run: |
|
run: |
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
apt-get -q install -qq make
|
apt-get -q install -qq \
|
||||||
|
make \
|
||||||
|
;
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
@ -43,7 +47,7 @@ jobs:
|
||||||
- run: make readme
|
- run: make readme
|
||||||
- run: git diff --exit-code --name-only README.md
|
- run: git diff --exit-code --name-only README.md
|
||||||
|
|
||||||
helm-lint:
|
lint-helm:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
- run: cat /etc/os-release
|
- run: cat /etc/os-release
|
||||||
|
@ -64,6 +68,8 @@ jobs:
|
||||||
|
|
||||||
- run: helm plugin install --version ${{ env.HELM_UNITTEST_VERSION }} https://github.com/helm-unittest/helm-unittest
|
- run: helm plugin install --version ${{ env.HELM_UNITTEST_VERSION }} https://github.com/helm-unittest/helm-unittest
|
||||||
|
|
||||||
|
- uses: https://github.com/sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 # v3.2.0
|
||||||
|
|
||||||
- name: install chart-testing
|
- name: install chart-testing
|
||||||
uses: https://github.com/helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
uses: https://github.com/helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
||||||
with:
|
with:
|
||||||
|
@ -147,6 +153,13 @@ jobs:
|
||||||
# rm "chart-testing_${HELM_CHART_TESTING_VERSION#v}_linux_amd64.tar.gz"
|
# rm "chart-testing_${HELM_CHART_TESTING_VERSION#v}_linux_amd64.tar.gz"
|
||||||
# ct --version
|
# ct --version
|
||||||
|
|
||||||
|
- uses: https://github.com/sigstore/cosign-installer@1fc5bd396d372bee37d608f955b336615edf79c8 # v3.2.0
|
||||||
|
|
||||||
|
- name: Install chart-testing
|
||||||
|
uses: https://github.com/helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
||||||
|
with:
|
||||||
|
version: v3.10.1 # renovate: datasource=github-releases depName=chart-testing packageName=helm/chart-testing
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
show-progress: false
|
show-progress: false
|
||||||
|
@ -162,33 +175,67 @@ jobs:
|
||||||
|
|
||||||
- run: kubectl get no -o wide
|
- run: kubectl get no -o wide
|
||||||
|
|
||||||
- name: Install chart-testing
|
|
||||||
uses: https://github.com/helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
|
||||||
with:
|
|
||||||
version: v3.10.1 # renovate: datasource=github-releases depName=chart-testing packageName=helm/chart-testing
|
|
||||||
|
|
||||||
# Catch-all required check for test matrix
|
# Catch-all required check for test matrix
|
||||||
test-success:
|
test-success:
|
||||||
needs:
|
needs:
|
||||||
- node-lint
|
- lint-node
|
||||||
- helm-lint
|
- lint-helm
|
||||||
- e2e
|
- e2e
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
if: always()
|
if: always()
|
||||||
steps:
|
steps:
|
||||||
- name: Fail for failed or cancelled node-lint
|
- name: Fail for failed or cancelled lint-node
|
||||||
if: |
|
if: |
|
||||||
needs.node-lint.result == 'failure' ||
|
needs.lint-node.result == 'failure' ||
|
||||||
needs.node-lint.result == 'cancelled'
|
needs.lint-node.result == 'cancelled'
|
||||||
run: exit 1
|
run: exit 1
|
||||||
- name: Fail for failed or cancelled helm-lint
|
- name: Fail for failed or cancelled lint-helm
|
||||||
if: |
|
if: |
|
||||||
needs.helm-lint.result == 'failure' ||
|
needs.lint-helm.result == 'failure' ||
|
||||||
needs.helm-lint.result == 'cancelled'
|
needs.lint-helm.result == 'cancelled'
|
||||||
run: exit 1
|
run: exit 1
|
||||||
- name: Fail for failed or cancelled e2e
|
- name: Fail for failed or cancelled e2e
|
||||||
if: |
|
if: |
|
||||||
needs.e2e.result == 'failure' ||
|
needs.e2e.result == 'failure' ||
|
||||||
needs.e2e.result == 'cancelled'
|
needs.e2e.result == 'cancelled'
|
||||||
run: exit 1
|
run: exit 1
|
||||||
|
|
||||||
|
publish:
|
||||||
|
runs-on: self-hosted
|
||||||
|
needs:
|
||||||
|
- test-success
|
||||||
|
|
||||||
|
if: ${{ github.ref_type == 'tag' }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: install helm
|
||||||
|
uses: https://github.com/azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
|
||||||
|
with:
|
||||||
|
version: v3.13.2 # renovate: datasource=github-releases depName=helm packageName=helm/helm
|
||||||
|
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
show-progress: false
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: .node-version
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- run: helm dependency build
|
||||||
|
- run: helm package --version "${GITHUB_REF_NAME#v}" -d tmp/ ./
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm run changelog "${GITHUB_REF_NAME#v}" tmp/changelog.md
|
||||||
|
|
||||||
|
- name: login to codeberg packages
|
||||||
|
run: echo ${TOKEN} | helm registry login -u viceice --password-stdin codeberg.org/forgejo-contrib
|
||||||
|
env:
|
||||||
|
TOKEN: ${{secrets.token}}
|
||||||
|
|
||||||
|
- name: publish chart
|
||||||
|
run: helm push tmp/forgejo-${GITHUB_REF_NAME#v}.tgz oci://codeberg.org/forgejo-contrib
|
||||||
|
|
||||||
|
- name: forgejo release
|
||||||
|
run: |
|
||||||
|
echo TODO: forgejo release
|
||||||
|
|
Loading…
Reference in a new issue