Skip to content

Commit

Permalink
feat: semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
Otanikotani committed Feb 27, 2020
1 parent 203624f commit 9b44230
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 64 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
name: Check

on:
push:
branches:
- 'master'
- 'feature/**'
- 'bugfix/**'
push:
branches:
- '^master'
- 'feature/**'
- 'bugfix/**'

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 8

- name: Run Unit tests
run: |
./gradlew test jacocoTestReport
- name: Run Unit tests
run: |
./gradlew test jacocoTestReport
- uses: codecov/codecov-action@v1
name: Upload coverage report to codecov
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./build/reports/jacoco/report.xml
fail_ci_if_error: true
- uses: codecov/codecov-action@v1
name: Upload coverage report to codecov
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./build/reports/jacoco/report.xml
fail_ci_if_error: true
71 changes: 46 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,51 @@
name: Release

on:
push:
tags:
- 'v*'
push:
branches:
- master


jobs:
release:
name: Release on GitHub
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 8

- name: Run Unit tests
run: |
./gradlew test jacocoTestReport
- name: Publish the plugin
run: ./gradlew publish
env:
USERNAME: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_intellijPublishToken: ${{ secrets.INTELLIJ_PUBLISH_TOKEN }}

verify:
name: Verify
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 8

- name: Run Unit tests
run: |
./gradlew test
release:
name: Semantic release
runs-on: ubuntu-latest
needs: verify
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
id: semantic
with:
extra_plugins: |
@semantic-release/github
@semantic-release/changelog
@semantic-release/release-notes-generator
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish the plugin
run: ./gradlew publish
env:
USERNAME: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_intellijPublishToken: ${{ secrets.INTELLIJ_PUBLISH_TOKEN }}
14 changes: 14 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"branches": ["master"],
"tagFormat": "v${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-releas/changelog", {
"changelogFile": "docs/CHANGELOG.md"
}],
["@semantic-release/git", {
"assets": ["docs/CHANGELOG.md"]
}]
]
}
10 changes: 6 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ intellij {
patchPluginXml {
dependsOn markdownToHtml

String content = new File("build/gen-html/CHANGELOG.html").text
changeNotes = """
changeNotes = {
String content = new File("build/gen-html/CHANGELOG.html").text
return """ <![CDATA[
$content
"""
]]"""
}
}

markdownToHtml {
sourceDir = new File(projectDir, "changelog")
sourceDir = new File(projectDir, "docs")
}

testlogger {
Expand Down
11 changes: 0 additions & 11 deletions changelog/CHANGELOG.md

This file was deleted.

0 comments on commit 9b44230

Please sign in to comment.