diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 98fca8977..118cd5931 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,14 +39,16 @@ jobs: uses: gradle/wrapper-validation-action@v1 - name: Build with Gradle - run: ./gradlew build + run: ./gradlew check + + - name: Install dependencies + run: npm ci + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npx semantic-release - - 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 build-package-parser: runs-on: ubuntu-latest 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/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 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": [] }