From 7963dc9f9aeffa0bebc91fc8d8e1666298700229 Mon Sep 17 00:00:00 2001 From: Hiroyuki Wada Date: Sat, 4 Apr 2020 17:30:28 +0900 Subject: [PATCH] chore: setup automated release by github actions --- .github/workflows/pull_request.yml | 24 +++++++++++++++++ .github/workflows/release.yml | 43 ++++++++++++++++++++++++++++++ .releaserc | 13 +++++++++ ear/pom.xml | 2 +- ejb/pom.xml | 2 +- pom.xml | 2 +- 6 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/pull_request.yml create mode 100644 .github/workflows/release.yml create mode 100644 .releaserc diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..11271fa --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,24 @@ +name: Pull Request CI + +on: [pull_request] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Cache for maven + uses: actions/cache@v1 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build with Maven + run: mvn -B package + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8c34f8e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release CI + +on: + push: + branches: + - master + +jobs: + build: + name: Build and release + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Setup node 10 + uses: actions/setup-node@v1 + with: + node-version: '10.x' + - name: Cache for maven + uses: actions/cache@v1 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Cache for npm + uses: actions/cache@v1 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('.github/workflows/release.yml') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Setup semantic-release + run: npm install -g @conveyal/maven-semantic-release semantic-release@15 @semantic-release/exec@v3.3.8 + - name: Release + run: semantic-release --use-conveyal-workflow --skip-maven-deploy + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..076bdce --- /dev/null +++ b/.releaserc @@ -0,0 +1,13 @@ +{ + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@conveyal/maven-semantic-release", + ["@semantic-release/github", { + "assets": [ + {"path": "ear/target/*.ear"} + ] + }] + ] +} + diff --git a/ear/pom.xml b/ear/pom.xml index 2764b40..e8a6409 100755 --- a/ear/pom.xml +++ b/ear/pom.xml @@ -3,7 +3,7 @@ org.keycloak.extensions keycloak-discord-parent - 0.3.0-SNAPSHOT + 0.2.1-SNAPSHOT Keycloak Discord EAR diff --git a/ejb/pom.xml b/ejb/pom.xml index f72985d..e7649a7 100755 --- a/ejb/pom.xml +++ b/ejb/pom.xml @@ -3,7 +3,7 @@ org.keycloak.extensions keycloak-discord-parent - 0.3.0-SNAPSHOT + 0.2.1-SNAPSHOT Keycloak Discord EJB diff --git a/pom.xml b/pom.xml index 01c68ac..54c046b 100755 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.keycloak.extensions keycloak-discord-parent - 0.3.0-SNAPSHOT + 0.2.1-SNAPSHOT pom