Skip to content

Setup GitHub Actions to release lib #1

Setup GitHub Actions to release lib

Setup GitHub Actions to release lib #1

Workflow file for this run

name: Build and Deploy to SonarType
on:
push:
branches:
- 'staging'
- 'epic/**'
- 'task/**'
jobs:
build-test:
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: Restore gradle.properties
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY: ${{ secrets.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=${SIGNING_KEY}">> ~/.gradle/gradle.properties
echo "SIGNING_KEY_PWD=${SIGNING_KEY_PWD}">> ~/.gradle/gradle.properties
# - name: Force break line gradle properties
# run: echo -e '\n' >> gradle.properties
# - run:
# name: Inject Maven signing key
# command: |
# echo $GPG_SIGNING_KEY \
# | awk 'NR == 1 { print "SIGNING_KEY=" } 1' ORS='\\n' \
# >> gradle.properties
- name: Snapshot Release Check
run: |
echo -e "\nIS_SNAPSHOT_RELEASE=$( [[ "${CIRCLE_BRANCH}" =~ ^task.* ]] && echo true || echo false )" >> gradle.properties
- run:
name: Publish to Maven

Check failure on line 54 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / Build and Deploy to SonarType

Invalid workflow file

The workflow is not valid. .github/workflows/release.yml (Line: 54, Col: 11): A mapping was not expected
command: ./gradlew assemble publish