-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from openstandia/new-build
build: update build system with alternative maven-semantic-release
- Loading branch information
Showing
4 changed files
with
62 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,52 +11,37 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, '[ci skip]')" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
with: | ||
# Disabling shallow clone is needed for correctly determing next release with semantic release | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'corretto' | ||
java-version: 11 | ||
cache: 'maven' | ||
server-id: ossrh | ||
server-username: OSSRH_JIRA_USERNAME | ||
server-password: OSSRH_JIRA_PASSWORD | ||
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | ||
gpg-passphrase: OSSRH_GPG_SECRET_KEY_PASSWORD | ||
- name: Cache for maven | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '10.x' | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- name: Cache for yarn | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-maven-semantic-release-v4.5.0 | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Setup semantic-release | ||
run: | | ||
yarn global add @conveyal/[email protected] semantic-release@15 | ||
echo "::add-path::$(yarn global bin)" | ||
|
||
- name: Test | ||
run: mvn -B test | ||
- name: Release | ||
# maven-semantic-release requires "maven-settings.xml" in the workspace directory | ||
run: | | ||
mv ~/.m2/settings.xml maven-settings.xml | ||
semantic-release --branch main --prepare @conveyal/maven-semantic-release \ | ||
--publish @semantic-release/github,@conveyal/maven-semantic-release \ | ||
--verify-conditions @semantic-release/github,@conveyal/maven-semantic-release \ | ||
--verify-release @conveyal/maven-semantic-release\ | ||
--use-conveyal-workflow | ||
|
||
- name: Semantic release | ||
id: semantic | ||
uses: cycjimmy/semantic-release-action@v4 | ||
with: | ||
semantic_version: 23 | ||
extra_plugins: | | ||
@semantic-release/changelog@6 | ||
@terrestris/maven-semantic-release@2 | ||
@semantic-release/git@10 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
OSSRH_JIRA_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,5 @@ | |
hs_err_pid* | ||
|
||
target | ||
|
||
.idea | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"branches": [ | ||
"main" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/changelog", | ||
[ | ||
"@terrestris/maven-semantic-release", | ||
{ | ||
"mavenTarget": "deploy", | ||
"clean": false, | ||
"updateSnapshotVersion": true, | ||
"settingsPath": "/home/runner/.m2/settings.xml", | ||
"processAllModules": true | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [ | ||
"CHANGELOG.md", "pom.xml", "**/pom.xml" | ||
], | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
} | ||
], | ||
"@semantic-release/github" | ||
] | ||
} |