Merge pull request #68 from what3words/task/MT-7117-Create-script-to-… #2
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: Build and Deploy to SonarType | |
on: | |
push: | |
branches: | |
- 'staging' | |
- 'epic/**' | |
jobs: | |
build_release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Enable KVM group perms | |
run: | | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
ls /dev/kvm | |
- name: Setup Java 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Restore gradle.properties | |
env: | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | |
SIGNING_KEY_PWD: ${{ secrets.SIGNING_KEY_PWD }} | |
shell: bash | |
run: | | |
mkdir -p ~/.gradle/ | |
echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV | |
echo "OSSRH_USERNAME=${OSSRH_USERNAME}">> ~/.gradle/gradle.properties | |
echo "OSSRH_PASSWORD=${OSSRH_PASSWORD}">> ~/.gradle/gradle.properties | |
echo "SIGNING_KEY=${GPG_SIGNING_KEY}">> ~/.gradle/gradle.properties | |
echo "SIGNING_KEY_PWD=${SIGNING_KEY_PWD}">> ~/.gradle/gradle.properties | |
cat ~/.gradle/gradle.properties | |
- name: Snapshot Release Check | |
run: | | |
echo -e "\nIS_SNAPSHOT_RELEASE=$( [[ "${CIRCLE_BRANCH}" =~ ^epic.* ]] && echo true || echo false )" >> gradle.properties | |
- name: Publish to Maven | |
run: ./gradlew assemble publish |