Build robot #43
Workflow file for this run
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
on: | |
push: | |
tags: | |
- 'v*' | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
name: Build robot | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
java: [ 11, 17, 21 ] | |
name: Java ${{ matrix.java }} build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.2.0 | |
with: | |
fetch-depth: 0 # To make git describe give the intended output | |
fetch-tags: true | |
- name: Setup Java | |
uses: actions/setup-java@v4.4.0 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: temurin | |
- name: Set SSH key | |
if: github.event_name != 'pull_request' | |
uses: webfactory/ssh-agent@v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- name: Add known host key | |
if: github.event_name != 'pull_request' | |
run: ssh-keyscan javacard.pro >> ~/.ssh/known_hosts | |
- name: Package | |
run: ./mvnw -P exe -T1C -U -B clean verify | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/v') && matrix.java == '11' | |
id: create_release | |
uses: softprops/action-gh-release@v2.0.8 | |
with: | |
files: | | |
tool/target/apdu4j.jar | |
tool/target/apdu4j.exe | |
fail_on_unmatched_files: true | |
body: Release ${{ github.ref_name }} | |
prerelease: true # manually promoted | |
- name: Deploy package | |
if: matrix.java == '11' && ( github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') ) | |
run: ./mvnw -T1C -B deploy |