From 4e9b7b65d04964c00c06a6b220a6f9327cc3a671 Mon Sep 17 00:00:00 2001 From: Lars Reimann Date: Mon, 20 Jun 2022 16:56:05 +0200 Subject: [PATCH 1/4] ci: no longer upload artifact in main workflow --- .github/workflows/main.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 98fca8977..57e80cbd7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,14 +39,7 @@ jobs: uses: gradle/wrapper-validation-action@v1 - name: Build with Gradle - run: ./gradlew build - - - name: Upload distribution - uses: actions/upload-artifact@v3 - with: - name: API-Editor - path: api-editor/backend/build/libs/*-all.jar - if-no-files-found: error + run: ./gradlew check build-package-parser: runs-on: ubuntu-latest From e501ec1e43c588cae3572fb1dcf07b616c098318 Mon Sep 17 00:00:00 2001 From: Lars Reimann Date: Mon, 20 Jun 2022 17:06:44 +0200 Subject: [PATCH 2/4] ci: configure semantic-release --- .github/workflows/main.yml | 10 ++++++ .github/workflows/tag.yml | 49 ----------------------------- api-editor/backend/build.gradle.kts | 2 +- release.config.js | 19 +++++++++++ tsconfig.eslint.json | 2 +- 5 files changed, 31 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/tag.yml create mode 100644 release.config.js diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 57e80cbd7..5bc92efec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,6 +41,16 @@ jobs: - name: Build with Gradle run: ./gradlew check + - name: Install dependencies + run: npm ci + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release + + build-package-parser: runs-on: ubuntu-latest defaults: diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml deleted file mode 100644 index 48ac8ebc0..000000000 --- a/.github/workflows/tag.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Tag - -on: - push: - tags: - - "v*" - -jobs: - build: - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./api-editor - - strategy: - matrix: - node-version: [ 16.x ] - java-version: [ 17 ] - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: npm - cache-dependency-path: api-editor/gui/package-lock.json - - - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: ${{ matrix.java-version }} - cache: gradle - - # See https://docs.github.com/en/actions/guides/building-and-testing-java-with-gradle - - name: Setup Gradle - uses: gradle/wrapper-validation-action@v1 - - - name: Build with Gradle - run: ./gradlew build - - - name: Release - uses: softprops/action-gh-release@v0.1.14 - with: - generate_release_notes: true - files: api-editor/backend/build/libs/*-all.jar diff --git a/api-editor/backend/build.gradle.kts b/api-editor/backend/build.gradle.kts index a177afd67..05a1af279 100644 --- a/api-editor/backend/build.gradle.kts +++ b/api-editor/backend/build.gradle.kts @@ -28,7 +28,7 @@ tasks.withType { } tasks.withType { - archiveFileName.set("${project.group}-${project.name}-${project.version}-all.jar") + archiveFileName.set("${project.group}-${project.name}-all.jar") } // Dependencies -------------------------------------------------------------------------------------------------------- diff --git a/release.config.js b/release.config.js new file mode 100644 index 000000000..932e5af31 --- /dev/null +++ b/release.config.js @@ -0,0 +1,19 @@ +module.exports = { + branches: ['main'], + plugins: [ + ['@semantic-release/commit-analyzer', { preset: 'conventionalcommits' }], + ['@semantic-release/release-notes-generator', { preset: 'conventionalcommits' }], + [ + '@semantic-release/github', + { + assets: [ + { + path: 'api-editor/backend/build/libs/*-all.jar', + name: 'api-editor-${nextRelease.gitTag}.jar', + label: 'API-Editor (${nextRelease.gitTag})', + }, + ], + }, + ], + ], +}; diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index 9ab51453a..c8cfd16d7 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -3,6 +3,6 @@ "compilerOptions": { "noEmit": true }, - "include": ["./.eslintrc.js", "./api-editor/gui/src/**/*", "./api-editor/gui/vite.config.ts"], + "include": ["./.eslintrc.js", "release.config.js", "./api-editor/gui/src/**/*", "./api-editor/gui/vite.config.ts"], "exclude": [] } From ca23893845d1587c2f9be00667f4ee88f42b9975 Mon Sep 17 00:00:00 2001 From: Lars Reimann Date: Mon, 20 Jun 2022 17:12:53 +0200 Subject: [PATCH 3/4] ci: only pass GITHUB_TOKEN --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5bc92efec..118cd5931 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,7 +47,6 @@ jobs: - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: npx semantic-release From b41fecd0c718c3ac963b0dc871fec92ffd84af38 Mon Sep 17 00:00:00 2001 From: Lars Reimann Date: Mon, 20 Jun 2022 17:14:41 +0200 Subject: [PATCH 4/4] docs: remove guide on how to prepare a release --- docs/Development/README.md | 5 --- docs/Development/how-to-prepare-a-release.md | 42 -------------------- 2 files changed, 47 deletions(-) delete mode 100644 docs/Development/README.md delete mode 100644 docs/Development/how-to-prepare-a-release.md diff --git a/docs/Development/README.md b/docs/Development/README.md deleted file mode 100644 index 8a6abffe3..000000000 --- a/docs/Development/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Development Guides - -* [Release Checklist][preparing-release]: How to prepare a release. - -[preparing-release]: how-to-prepare-a-release.md diff --git a/docs/Development/how-to-prepare-a-release.md b/docs/Development/how-to-prepare-a-release.md deleted file mode 100644 index 7c97b78e3..000000000 --- a/docs/Development/how-to-prepare-a-release.md +++ /dev/null @@ -1,42 +0,0 @@ -# How to prepare a release - -1. Bump the version of the backend and desktop app in [build.gradle.kts][main-build-gradle]: - ```kts - subprojects { - // ... - version = "1.0.0" - // ... - } - ``` - -2. Bump the version of the GUI in [package.json][vscode-package-json]: - ```json5 - { - // ... - "version": "1.0.0", - // ... - } - ``` -3. Run this command to also update the associated `package-lock.json` file: - ```sh - cd api-editor/gui - npm i - ``` -4. Bump the version of the package parser in [pyproject.toml][parser-pyproject-toml]: - ```toml - [tool.poetry] - # ... - version = "1.0.0" - # ... - ``` -6. Commit the changes in a new branch. -7. Create a pull request. -8. Merge the pull request into main. -9. Add a tag starting with "v" followed by the new version number to the commit on main. -10. Push the tag to main (`git push --tags`). - -[main-build-gradle]: ../../api-editor/build.gradle.kts - -[vscode-package-json]: ../../api-editor/gui/package.json - -[parser-pyproject-toml]: ../../package-parser/pyproject.toml