Skip to content

Update GH actions

Update GH actions #70

Workflow file for this run

on:
push:
tags:
- 'v*'
branches:
- master
- next
pull_request:
branches:
- master
name: Robot builder
jobs:
build:
runs-on: ubuntu-24.04
strategy:
matrix:
java: [ 8, 11, 17, 21 ]
name: Java ${{ matrix.java }}
steps:
- name: Checkout with submodules
uses: actions/checkout@v4.1.7
with:
submodules: true
fetch-depth: 0 # To make git describe give the intended output
fetch-tags: true
- name: Setup java
uses: actions/setup-java@v4.2.1
with:
java-version: ${{ matrix.java }}
distribution: temurin
cache: maven
- 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 host key
if: github.event_name != 'pull_request'
run: ssh-keyscan javacard.pro >> ~/.ssh/known_hosts
- name: Run Maven for capfile
if: matrix.java != 8
run: ./mvnw -T1C -B -U verify
- name: Run ANT tests
run: ant test dist
- name: Get SHA-256 of ant-javacard.jar
run: echo "JARSUM=$(shasum -a 256 --tag ant-javacard.jar)" >> "$GITHUB_ENV"
- name: Deploy package or snapshot
if: github.event_name != 'pull_request' && matrix.java == '11'
run: ./mvnw -B -U deploy
- name: Upload
if: github.event_name != 'pull_request' && matrix.java == '11'
uses: actions/upload-artifact@v4.3.4
with:
name: ant-javacard.jar
path: ant-javacard.jar
- 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: |
ant-javacard.jar
fail_on_unmatched_files: true
body: "Release ${{ github.ref_name }}, `${{ env.JARSUM }}` (built with JDK-11)"
prerelease: true # manually promoted