diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 77dc921..dafe0a6 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -2,7 +2,7 @@ name: Java CI with Maven on: push: - branches: [ "main" ] + branches: [ "main", "release-workflow" ] pull_request: branches: [ "main" ] @@ -34,14 +34,41 @@ jobs: - name: Check sources with Maven run: | - mvn -B --file jgpio/pom.xml license:check + mvn -B -f jgpio/pom.xml license:check # TODO check formatting - name: Build with Maven run: | ./prepare.sh - mvn -B install --file jgpio/pom.xml -Djextract.bin=../jextract/bin/jextract + mvn -B install -f jgpio/pom.xml -Djextract.bin=../jextract/bin/jextract - name: Build IT with Maven - run: mvn -B package --file jgpio-it/pom.xml - # TODO run IT on remote Orange Pi One Plus + run: mvn -B package -f jgpio-it/pom.xml + + - uses: actions/upload-artifact@v4 + with: + name: jgpio-target + path: jgpio/target + + test-it: + needs: [build] + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 23 + uses: actions/setup-java@v4 + with: + java-version: '23' + distribution: 'temurin' + cache: maven + + - uses: actions/download-artifact@v4 + with: + name: jgpio-target + path: jgpio/target + + - name: Test IT + run: | + mvn -B jar:jar install:install -f jgpio/pom.xml + mvn -B verify -f jgpio-it/pom.xml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..849ffc5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +name: Release + +on: + push: + branches: [ "release-workflow" ] + workflow_dispatch: + inputs: + version: + description: 'Release version' + required: true + nextVersion: + description: 'Next version after release (-SNAPSHOT will be added automatically)' + required: true + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 23 + uses: actions/setup-java@v4 + with: + java-version: '23' + distribution: 'temurin' + cache: maven + + - name: Set release version +#${{ github.event.inputs.version }} + run: | + mvn -B -ntp -f jgpio/pom.xml versions:set -DnewVersion=1.2.5 + mvn -B -ntp -f jgpio-it/pom.xml versions:set -DnewVersion=1.2.5 + mvn -B -ntp -f examples/pom.xml versions:set-property -Dproperty=jgpio.version -DnewVersion=1.2.5 + sed -i '//s/>.*1.2.5