Update README to remove no-longer-necessary options #9
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: Generate Snapshot | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
publishsnapshot: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@v3 | |
- name: Get latest commit SHA | |
id: gitsha | |
run: echo "sha=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT | |
- name: Get source code version number | |
id: gitversion | |
run: echo "version=$(grep -o "versionString = [^, ;]*" src/main/java/com/fazecast/jSerialComm/SerialPort.java | grep -o "\".*\"" | grep -o [^\"].*[^\"])" >> $GITHUB_OUTPUT | |
- name: Update library version string | |
run: sed -i "s/versionString = [^, ;]*/versionString = \"${{ steps.gitversion.outputs.version }}-${{ steps.gitsha.outputs.sha }}-SNAPSHOT\"/g" src/main/java/com/fazecast/jSerialComm/SerialPort.java | |
- name: Build native libraries using Docker toolchain | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: fazecast/jserialcomm:builder | |
options: --user root --privileged --rm -v ${{ github.workspace }}:/home/toolchain/jSerialComm | |
run: /home/toolchain/compile.sh libs | |
- name: Set up Java build environment | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '11' | |
- name: Build SNAPSHOT using Gradle | |
uses: gradle/gradle-build-action@v2.4.2 | |
env: | |
LIB_VERSION: ${{ steps.gitversion.outputs.version }}-SNAPSHOT | |
with: | |
gradle-version: 8.1.1 | |
arguments: build | |
- name: Publish SNAPSHOT using Gradle | |
uses: gradle/gradle-build-action@v2.4.2 | |
env: | |
LIB_VERSION: ${{ steps.gitversion.outputs.version }}-SNAPSHOT | |
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }} | |
SIGNING_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
with: | |
gradle-version: 8.1.1 | |
arguments: publish |