diff --git a/.github/workflows/auto release.yml b/.github/workflows/auto release.yml deleted file mode 100644 index bf277b3..0000000 --- a/.github/workflows/auto release.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: AutoRelease - -on: - push: - branches: [ master ] - -jobs: - release: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '14' - - - name: Install dependencies - run: npm install - - - name: Build - run: npm run build - - - name: Install unzip - run: sudo apt-get update && sudo apt-get install -y unzip - - - name: Download Artifact - uses: actions/download-artifact@v3 - with: - name: Artifacts - path: ./build/libs - - - name: Unzip Artifact - run: | - echo "Unzipping artifact..." - unzip -d ./extracted ./build/libs/Artifacts.zip - ls -l ./extracted - - - name: Create and Push Tag - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - TAG_NAME="v${{ github.run_number }}" - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git tag $TAG_NAME - git push origin $TAG_NAME - - - name: Create GitHub Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.create_and_push_tag.outputs.tag }} - release_name: "Release ${{ steps.create_and_push_tag.outputs.tag }}" - body: | - Changes in this release: - - Add your changes here - draft: false - prerelease: false - - - name: Upload Release Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./extracted/*.jar - asset_name: $(basename ./extracted/*.jar) - asset_content_type: application/java-archive \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b01da52..81a8604 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,35 +3,35 @@ # certain platforms or Java versions, and provides a first line of defence # against bad commits. -name: build -on: [pull_request, push] +# name: build +# on: [pull_request, push] -jobs: - build: - strategy: - matrix: - # Use these Java versions - java: [ - 21, # Current Java LTS - ] - runs-on: ubuntu-22.04 - steps: - - name: checkout repository - uses: actions/checkout@v4 - - name: validate gradle wrapper - uses: gradle/wrapper-validation-action@v2 - - name: setup jdk ${{ matrix.java }} - uses: actions/setup-java@v4 - with: - java-version: ${{ matrix.java }} - distribution: 'microsoft' - - name: make gradle wrapper executable - run: chmod +x ./gradlew - - name: build - run: ./gradlew build - - name: capture build artifacts - if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java - uses: actions/upload-artifact@v4 - with: - name: Artifacts - path: build/libs/ \ No newline at end of file +# jobs: + # build: + # strategy: + # matrix: + # # Use these Java versions + # java: [ + # 21, # Current Java LTS + # ] + # runs-on: ubuntu-22.04 + # steps: + # - name: checkout repository + # uses: actions/checkout@v4 + # - name: validate gradle wrapper + # uses: gradle/wrapper-validation-action@v2 + # - name: setup jdk ${{ matrix.java }} + # uses: actions/setup-java@v4 + # with: + # java-version: ${{ matrix.java }} + # distribution: 'microsoft' + # - name: make gradle wrapper executable + # run: chmod +x ./gradlew + # - name: build + # run: ./gradlew build + # - name: capture build artifacts + # if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java + # uses: actions/upload-artifact@v4 + # with: + # name: Artifacts + # path: build/libs/ \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index bef6870..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This is a basic workflow to help you get started with the GitHub Auto-Release on Commit Action. - -name: AutoRelease - -on: - push: - branches: [ master ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - release: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - uses: actions/checkout@v2 - - uses: CupOfTea696/gh-action-auto-release@v1.0.2 - with: - title: "Release: $version" - tag: "v$semver" - draft: false - regex: "/^Release: #{semver}$/i" - env: - GITHUB_TOKEN: ${{ secrets.GB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..01bcb03 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Release + +on: + workflow_dispatch: + +jobs: + release: + permissions: + contents: write + issues: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - run: npm ci + - run: npm run build + - run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/release.config.js b/release.config.js new file mode 100644 index 0000000..17f90e0 --- /dev/null +++ b/release.config.js @@ -0,0 +1,14 @@ +const config = { + branches: ['main'], + plugins: [ + '@semantic-release/commit-analyzer', + '@semantic-release/release-notes-generator', + ["@semantic-release/git", { + "assets": ["dist/*.js", "dist/*.js.map"], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + }], + '@semantic-release/github' + ] +}; + +module.exports = config;