From c07914c99f8f836c3d1bc1549698133c0e14977a Mon Sep 17 00:00:00 2001 From: Kristof Kovacs <49001742+kristofbolyai@users.noreply.github.com> Date: Wed, 23 Aug 2023 12:51:03 +0200 Subject: [PATCH] chore: Move to Jitpack --- .github/.config.js | 22 ------ .github/.pre-commit.js | 13 ---- .github/workflows/release.yml | 125 ---------------------------------- .idea/misc.xml | 1 - build.gradle.kts | 2 +- jitpack.yml | 2 + 6 files changed, 3 insertions(+), 162 deletions(-) delete mode 100644 .github/.config.js delete mode 100644 .github/.pre-commit.js delete mode 100644 .github/workflows/release.yml create mode 100644 jitpack.yml diff --git a/.github/.config.js b/.github/.config.js deleted file mode 100644 index 95f9553..0000000 --- a/.github/.config.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -const config = require("conventional-changelog-conventionalcommits"); - -module.exports = config({ - types: [ - // Unhide all types except "ci" so that they show up on generated changelog - // Default values: - // https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-conventionalcommits/writer-opts.js - { type: "feat", section: "New Features" }, - { type: "feature", section: "New Features" }, - { type: "fix", section: "Bug Fixes" }, - { type: "perf", section: "Performance Improvements" }, - { type: "revert", section: "Reverts" }, - { type: "docs", section: "Documentation" }, - { type: "style", section: "Styles" }, - { type: "chore", section: "Miscellaneous Chores" }, - { type: "refactor", section: "Code Refactoring" }, - { type: "test", section: "Tests" }, - { type: "build", section: "Build System" }, - { type: "ci", section: "Continuous Integration", hidden: true }, - ], -}); \ No newline at end of file diff --git a/.github/.pre-commit.js b/.github/.pre-commit.js deleted file mode 100644 index 9153af4..0000000 --- a/.github/.pre-commit.js +++ /dev/null @@ -1,13 +0,0 @@ -const fs = require("fs"); - -exports.preCommit = (props) => { - const replace = (path, searchValue, replaceValue) => { - let content = fs.readFileSync(path, "utf-8"); - if (content.match(searchValue)) { - fs.writeFileSync(path, content.replace(searchValue, replaceValue)); - console.log(`"${path}" changed`); - } - }; - - replace("./build.gradle.kts", /(?<=version = ")(\d+\.\d+\.\d+)(?=")/, props.version); -}; \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index cd93aed..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: Publish Release - -on: - push: - branches: - - master - workflow_dispatch: - -jobs: - changelog: - name: Generate Changelog - runs-on: ubuntu-latest - outputs: - tag: ${{ steps.changelog.outputs.tag }} - skipped: ${{ steps.changelog.outputs.skipped }} - clean_changelog: ${{ steps.changelog.outputs.clean_changelog }} - changelog: ${{ steps.changelog.outputs.changelog }} - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - token: ${{ secrets.PRIVATE_TOKEN }} - - - uses: actions/setup-node@v3 - with: - node-version: 16 - - run: npm install conventional-changelog-conventionalcommits - - - name: Create changelog - id: changelog - uses: DevScyu/conventional-changelog-action@v4 - with: - github-token: ${{ secrets.PRIVATE_TOKEN }} - preset: conventionalcommits - release-count: 0 - pre-commit: ./.github/.pre-commit.js - config-file-path: ./.github/.config.js - skip-version-file: true - create-summary: true - skip-git-pull: true - - - name: Upload version information - uses: actions/upload-artifact@v3 - with: - name: build - path: build.gradle.kts - - build: - name: Build - needs: [changelog] # Build needs the new version number - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - uses: actions/download-artifact@v3 # Download version information from changelog - with: - name: build - - - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - cache: "gradle" - - - name: Build - env: - BUILD_NUMBER: ${{ github.run_number }} - run: ./gradlew build - - - name: Upload build - uses: actions/upload-artifact@v3 - with: - name: build - path: build/libs - - release-to-gh: - name: Release to GitHub - runs-on: ubuntu-latest - needs: [changelog, build] - if: ${{ needs.changelog.outputs.skipped == 'false' }} - steps: - - uses: actions/download-artifact@v3 - with: - name: build - path: build/libs - - - name: Rename artifact - run: mv build/libs/HadesProtocol-*.jar build/HadesProtocol-${{ needs.changelog.outputs.tag }}.jar - - - name: Create release - uses: softprops/action-gh-release@v1 - with: - files: build/HadesProtocol-${{ needs.changelog.outputs.tag }}.jar - tag_name: ${{ needs.changelog.outputs.tag }} - body: ${{ needs.changelog.outputs.clean_changelog }} - - publish: - name: Publish to Github Packages - runs-on: ubuntu-latest - needs: [ build, changelog ] - if: ${{ needs.changelog.outputs.skipped == 'false' }} - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v3 - - - uses: actions/download-artifact@v3 # Download version information from changelog - with: - name: build - - - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b - - - name: Publish package - uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 - with: - arguments: publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 7edc3a5..afed43f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/build.gradle.kts b/build.gradle.kts index ecc031a..e9bab5b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } group = "com.wynntils.hades" -version = "0.5.0" +version = "0.5.1" repositories { mavenCentral() diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 0000000..1e41e00 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +jdk: + - openjdk17 \ No newline at end of file