From 0be7ca908900ac6b505c2f327e9f408b4c4a07af Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Thu, 7 Dec 2023 12:08:36 +0100 Subject: [PATCH] ci: update --- .forgejo/workflows/build.yml | 79 ++++++++++++++++++++++++++++-------- 1 file changed, 63 insertions(+), 16 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 01c591c..b05bd64 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -6,6 +6,8 @@ on: branches: - main - release/** + tags: + - v* permissions: contents: read @@ -18,7 +20,7 @@ env: KUBECTL_VERSION: v1.21.0 # renovate: datasource=github-releases depName=kubectl packageName=kubernetes/kubernetes jobs: - node-lint: + lint-node: runs-on: self-hosted steps: - run: cat /etc/os-release @@ -26,7 +28,9 @@ jobs: - name: install deps run: | apt-get update -qq - apt-get -q install -qq make + apt-get -q install -qq \ + make \ + ; - uses: actions/checkout@v4 with: @@ -43,7 +47,7 @@ jobs: - run: make readme - run: git diff --exit-code --name-only README.md - helm-lint: + lint-helm: runs-on: self-hosted steps: - 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 + - 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: @@ -147,6 +153,13 @@ jobs: # rm "chart-testing_${HELM_CHART_TESTING_VERSION#v}_linux_amd64.tar.gz" # 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 with: show-progress: false @@ -162,33 +175,67 @@ jobs: - 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 test-success: needs: - - node-lint - - helm-lint + - lint-node + - lint-helm - e2e runs-on: self-hosted timeout-minutes: 1 if: always() steps: - - name: Fail for failed or cancelled node-lint + - name: Fail for failed or cancelled lint-node if: | - needs.node-lint.result == 'failure' || - needs.node-lint.result == 'cancelled' + needs.lint-node.result == 'failure' || + needs.lint-node.result == 'cancelled' run: exit 1 - - name: Fail for failed or cancelled helm-lint + - name: Fail for failed or cancelled lint-helm if: | - needs.helm-lint.result == 'failure' || - needs.helm-lint.result == 'cancelled' + needs.lint-helm.result == 'failure' || + needs.lint-helm.result == 'cancelled' run: exit 1 - name: Fail for failed or cancelled e2e if: | needs.e2e.result == 'failure' || needs.e2e.result == 'cancelled' 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