From 9add9af8afde5b72c585855317a2a4b9dbcb6d39 Mon Sep 17 00:00:00 2001 From: Florian Sanders Date: Tue, 21 May 2024 23:13:30 +0200 Subject: [PATCH] feat(action): merge with master after release --- .githooks/commit-msg | 3 - .github/workflows-old/build.yml | 46 ---------- .github/workflows-old/git.yml | 13 --- .github/workflows-old/preview.yml | 110 ----------------------- .github/workflows-old/publish.yml | 61 ------------- .github/workflows-old/release-please.yml | 17 ---- .github/workflows/update-flake.yml | 1 + 7 files changed, 1 insertion(+), 250 deletions(-) delete mode 100755 .githooks/commit-msg delete mode 100644 .github/workflows-old/build.yml delete mode 100644 .github/workflows-old/git.yml delete mode 100644 .github/workflows-old/preview.yml delete mode 100644 .github/workflows-old/publish.yml delete mode 100644 .github/workflows-old/release-please.yml diff --git a/.githooks/commit-msg b/.githooks/commit-msg deleted file mode 100755 index 4042ebf..0000000 --- a/.githooks/commit-msg +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env sh - -npx --no -- commitlint --edit diff --git a/.github/workflows-old/build.yml b/.github/workflows-old/build.yml deleted file mode 100644 index a8bbd87..0000000 --- a/.github/workflows-old/build.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: 'Build' -on: - push: - branches: - - master - pull_request: - branches: - - master -jobs: - build: - name: 'Build' - runs-on: ubuntu-latest - - steps: - - name: '[Prepare] Checkout' - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: '[Prepare] Setup Node.js' - uses: actions/setup-node@v3 - with: - node-version-file: 'package.json' - cache: 'npm' - - name: '[Prepare] Install dependencies' - run: npm ci - - - name: '[Code quality] Check commit message' - if: github.event_name == 'pull_request' - run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose - - - name: '[Code quality] Check ESLint' - run: npm run lint - - - name: '[Build] [Prepare] Setup ruby' - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.3' - bundler-cache: true - - name: '[Build] [Prepare] Install fpm' - run: gem install fpm - - name: '[Build] [Run] Build' - run: node scripts/job-build.js 0.0.0 --latest --bundle - env: - RPM_GPG_PRIVATE_KEY: ${{ secrets.RPM_GPG_PRIVATE_KEY }} - RPM_GPG_NAME: 'Clever Cloud Nexus (rpm)' - RPM_GPG_PASS: ${{ secrets.RPM_GPG_PASSPHRASE }} diff --git a/.github/workflows-old/git.yml b/.github/workflows-old/git.yml deleted file mode 100644 index 87fe971..0000000 --- a/.github/workflows-old/git.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Git Checks - -on: - - pull_request - -jobs: - block-fixup: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Block Fixup Commits - uses: 13rac1/block-fixup-merge-action@v2.0.0 diff --git a/.github/workflows-old/preview.yml b/.github/workflows-old/preview.yml deleted file mode 100644 index eed2e73..0000000 --- a/.github/workflows-old/preview.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: 'Preview' -on: - pull_request: - types: - - synchronize - - opened - - closed - -env: - BRANCH: ${{ github.event.pull_request.head.ref }} - CC_CLEVER_TOOLS_PREVIEWS_CELLAR_KEY_ID: ${{ secrets.CC_CLEVER_TOOLS_PREVIEWS_CELLAR_KEY_ID }} - CC_CLEVER_TOOLS_PREVIEWS_CELLAR_SECRET_KEY: ${{ secrets.CC_CLEVER_TOOLS_PREVIEWS_CELLAR_SECRET_KEY }} - -jobs: - wait_for_build: - name: 'Wait for build to succeed' - if: | - (github.event.action == 'synchronize' || github.event.action == 'opened') - && github.event.repository.fork == false - && !startsWith(github.event.pull_request.head.ref, 'release-please--') - runs-on: ubuntu-latest - steps: - - name: 'Wait for build to succeed' - uses: lewagon/wait-on-check-action@v1.3.1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - check-name: Build - ref: ${{ github.event.pull_request.head.sha }} - allowed-conclusions: success - publish: - name: 'Publish Preview' - needs: wait_for_build - runs-on: ubuntu-latest - steps: - - name: '[Prepare] Checkout' - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: '[Prepare] Setup Node.js' - uses: actions/setup-node@v3 - with: - node-version-file: 'package.json' - cache: 'npm' - - name: '[Prepare] Install dependencies' - run: npm ci - - name: '[Prepare] Check if a preview already exists' - id: check_preview - run: | - if node scripts/job-preview.js get ${BRANCH} > /dev/null 2>&1; then - echo "exists=yes" >> $GITHUB_OUTPUT - else - echo "exists=no" >> $GITHUB_OUTPUT - fi - - - name: '[Run] Build preview' - run: node scripts/job-preview.js build ${BRANCH} - - name: '[Run] Publish preview' - run: node scripts/job-preview.js publish ${BRANCH} - - - name: '[Finalize] Get preview links' - if: steps.check_preview.outputs.exists == 'no' - id: get_preview_links - run: | - PREVIEW_LINKS=$(node scripts/job-preview.js links $BRANCH | sed -z 's/\n/\\n/g'; echo) - echo "PREVIEW_LINKS=${PREVIEW_LINKS::-2}" >> $GITHUB_ENV - - name: '[Finalize] Add comment' - if: steps.check_preview.outputs.exists == 'no' - uses: actions/github-script@v6 - with: - script: | - const links = "${{ env.PREVIEW_LINKS }}"; - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: `๐Ÿ”Ž A preview has been automatically published:\n\n${links}\n\n\n_This preview will be deleted once this PR is closed._` - }); - delete: - if: | - github.event.action == 'closed' - && github.event.repository.fork == false - && !startsWith(github.event.pull_request.head.ref, 'release-please--') - name: 'Delete Preview' - runs-on: ubuntu-latest - steps: - - name: '[Prepare] Checkout' - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: '[Prepare] Setup Node.js' - uses: actions/setup-node@v3 - with: - node-version-file: 'package.json' - cache: 'npm' - - name: '[Prepare] Install dependencies' - run: npm ci - - - name: '[Run] Delete preview' - run: node scripts/job-preview.js delete ${BRANCH} - - - name: '[Finalize] Add comment' - uses: actions/github-script@v6 - with: - script: | - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: `๐Ÿ”Ž The preview has been automatically deleted.` - }); diff --git a/.github/workflows-old/publish.yml b/.github/workflows-old/publish.yml deleted file mode 100644 index cfea973..0000000 --- a/.github/workflows-old/publish.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: 'Publish' -on: - push: - tags: - - '[0-9]+.[0-9]+.[0-9]+' - -env: - VERSION: ${{ github.ref_name }} - CC_CLEVER_TOOLS_RELEASES_CELLAR_KEY_ID: ${{ secrets.CC_CLEVER_TOOLS_RELEASES_CELLAR_KEY_ID }} - CC_CLEVER_TOOLS_RELEASES_CELLAR_SECRET_KEY: ${{ secrets.CC_CLEVER_TOOLS_RELEASES_CELLAR_SECRET_KEY }} - RPM_GPG_PRIVATE_KEY: ${{ secrets.RPM_GPG_PRIVATE_KEY }} - RPM_GPG_NAME: 'Clever Cloud Nexus (rpm)' - RPM_GPG_PASS: ${{ secrets.RPM_GPG_PASSPHRASE }} - NEXUS_USER: ${{ secrets.NEXUS_USER }} - NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} - NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - -jobs: - publish_cellar: - name: 'Publish' - runs-on: ubuntu-latest - steps: - - name: '[Prepare] Checkout' - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: '[Prepare] Setup Node.js' - uses: actions/setup-node@v3 - with: - node-version-file: 'package.json' - cache: 'npm' - - name: '[Prepare] Install dependencies' - run: npm ci - - name: '[Prepare] Setup ruby' - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.3' - bundler-cache: true - - name: '[Prepare] Install fpm' - run: gem install fpm - - name: '[Prepare] Setup ssh-agent' - uses: webfactory/ssh-agent@v0.8.0 - with: - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - - - name: '[Build] version ${{ env.VERSION }}' - run: node scripts/job-build.js "${VERSION}" --latest --bundle - - - name: '[Publish] version ${{ env.VERSION }}' - run: node scripts/job-publish.js "${VERSION}" - - - name: '[Publish] Upload artifacts to GitHub Release' - shell: bash - run: | - gh release upload "${VERSION}" $(find build/${{ github.ref_name }}/archive -maxdepth 1 -type f -name "*$VERSION*" -print) - gh release upload "${VERSION}" $(find build/${{ github.ref_name }}/bundle -maxdepth 1 -type f -print) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows-old/release-please.yml b/.github/workflows-old/release-please.yml deleted file mode 100644 index 83da5d9..0000000 --- a/.github/workflows-old/release-please.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: 'release-please' -on: - push: - branches: - - master - - 'hotfix/**' -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - with: - token: ${{ secrets.CI_TOKEN }} - release-type: node - include-v-in-tag: false - default-branch: ${{ github.ref_name }} - changelog-types: '[{"type": "feat", "section": "๐Ÿš€ Features"}, {"type": "fix", "section": "๐Ÿ› Bug Fixes"}, {"type": "perf", "section": "๐Ÿ’ช Performance Improvements"}, {"type": "deps", "section": "๐Ÿ—ƒ๏ธ Dependencies", "hidden": true}, {"type": "revert", "section": "โ†ฉ Reverts"}, {"type": "docs", "section": "๐Ÿ“– Documentation", "hidden": true}, {"type": "style", "section": "๐ŸŽจ Styles", "hidden": true}, {"type": "chore", "section": "๐Ÿงน Miscellaneous Chores", "hidden": true}, {"type": "refactor", "section": "๐Ÿ›  Code Refactoring", "hidden": true}, {"type": "test", "section": "๐Ÿ”ฌ Tests", "hidden": true}, {"type": "build", "section": "๐Ÿ—๏ธ Build System", "hidden": true}, {"type": "ci", "section": "๐Ÿค– Continuous Integration", "hidden": true}]' diff --git a/.github/workflows/update-flake.yml b/.github/workflows/update-flake.yml index 9852d09..2659895 100644 --- a/.github/workflows/update-flake.yml +++ b/.github/workflows/update-flake.yml @@ -106,3 +106,4 @@ jobs: git tag -a ${{ github.ref_name }} -m "Release ${{ github.ref_name }}" git push -f --tags git push -f + git push origin ${{ github.ref_name }}:master