Merge pull request #55 from openstandia/feat-support-4.0 #145
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
name: Release package to the Maven Central Repository | |
on: | |
push: | |
branches: | |
- support-4.0 | |
jobs: | |
build: | |
name: Build and release | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[ci skip]')" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
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 | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Set up go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: '1.17.3' | |
- name: Install protoc-gen-doc | |
run: go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc | |
- 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 "$(yarn global bin)" >> $GITHUB_PATH | |
- 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 support-4.0 --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 | |
timeout-minutes: 30 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
OSSRH_JIRA_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }} | |
OSSRH_JIRA_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }} | |
OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} |