From add6b921547a598052c6ae606e00d3a3775063f0 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Wed, 3 Jan 2024 08:38:23 +0100 Subject: [PATCH] feat: switch to github and npmjs --- .github/workflows/publish.yml | 32 ++++++++++++++ .github/workflows/test.yml | 32 ++++++++++++++ .node-version | 1 + .npmrc | 4 -- Jenkinsfile | 83 ----------------------------------- renovate.json | 4 +- 6 files changed, 67 insertions(+), 89 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/test.yml create mode 100644 .node-version delete mode 100644 Jenkinsfile diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..af41216 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: publish + +on: + push: + tags: + - v* + +permissions: + contents: read + +jobs: + publish-npm: + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - uses: actions/checkout@v3 + - run: corepack enable + - uses: actions/setup-node@v3 + with: + node-version-file: .node-version + registry-url: https://registry.npmjs.org/ + - run: pnpm install + - run: pnpm version ${GITHUB_REF_NAME#v} + - run: pnpm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + - uses: ncipollo/release-action@v1.13.0 + with: + generateReleaseNotes: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..107acd5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +name: test + +on: + push: + merge_group: + pull_request: + branches: + - main + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - run: corepack enable + + - uses: actions/setup-node@v3 + with: + node-version-file: .node-version + + - run: pnpm install + + - run: pnpm lint:prettier + - run: pnpm pack diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..d5a1596 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +20.10.0 diff --git a/.npmrc b/.npmrc index 7f49a6d..4415bdd 100644 --- a/.npmrc +++ b/.npmrc @@ -7,7 +7,3 @@ git-checks = false # pnpm run settings # https://pnpm.io/cli/run shell-emulator = true - -@visualon:registry = https://forgejo.visualon.de/api/packages/vt/npm/ - -//forgejo.visualon.de/:always-auth = true diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 3afb2d5..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env groovy - -pipeline { - agent { - docker { - label 'docker && linux' - image 'ghcr.visualon.de/visualon/builder:5.1.44@sha256:de34ab1e465c09082f8fec433ef961c077dcc2d8a31ed3b85c5be1cf68c5c1bf' - } - } - - environment { - GITEA_CI_TOKEN = credentials('gitea-ci-token') - } - - options { - disableConcurrentBuilds(abortPrevious: true) - parallelsAlwaysFailFast() - timeout(time: 6, unit: 'HOURS') - ansiColor('xterm') - buildDiscarder logRotator(artifactDaysToKeepStr: env.BRANCH_NAME == 'main' ? '14' : '', numToKeepStr: env.BRANCH_NAME == 'main' ? '50' : '') - } - - stages { - stage('init') { - steps { - echo "Node: ${NODE_NAME}" - discoverGitReferenceBuild() - } - } - - stage('setup') { - options { - timeout(time: 15, unit: 'MINUTES') - } - steps { - echo "Node: ${NODE_NAME}" - cache(maxCacheSize: 250, defaultBranch: 'main', caches: [arbitraryFileCache(path: '.pnpm-store', cacheValidityDecidingFile: 'pnpm-lock.yaml', compressionMethod: 'TAR_ZSTD')]) { - sh 'pnpm install' - } - } - } - - stage('lint') { - options { - timeout(time: 10, unit: 'MINUTES') - } - steps { - // sh 'yarn type-check' - sh 'pnpm lint:prettier' - // sh 'yarn lint:eslint --format checkstyle -o coverage/eslint.xml' TODO: fix linting OOM - } - // post { - // always { - // recordIssues enabledForFailure: true, tool: esLint(pattern: 'coverage/eslint.xml'), trendChartType: 'AGGREGATION_ONLY' - // } - // } - } - - stage('publish-packages') { - - options { - timeout(time: 15, unit: 'MINUTES') - } - - when { - buildingTag() - } - - environment { - GITEA_TOKEN = credentials('gitea-ci-token') - } - - steps { - sh 'echo \'//forgejo.visualon.de/api/packages/vt/npm/:_authToken=${GITEA_TOKEN}\' >> ~/.npmrc' - sh 'pnpm version ${TAG_NAME#v}' - sh 'pnpm publish' - sh 'pnpm start' - } - } - - } -} - diff --git a/renovate.json b/renovate.json index 557beca..e4ea5c5 100644 --- a/renovate.json +++ b/renovate.json @@ -1,5 +1,5 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["vo/renovate-config", "vo/renovate-config:automergePatch"], - "reviewers": ["kriese", "reitz"] + "extends": ["visualon/renovate-config"], + "reviewers": ["viceice"] }