Skip to content

Switch from Travis to GitHub Actions #6

Switch from Travis to GitHub Actions

Switch from Travis to GitHub Actions #6

Workflow file for this run

name: Java CI with Maven
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: windows-latest
permissions: write-all
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Determine release version
id: release-version
run: |
echo "VERSION=$(mvn help:evaluate '-Dexpression=project.version' -q -DforceStdout)" >> $env:GITHUB_OUTPUT
- run: mkdir staging && cp target/*.* staging && rm staging/original* && rm staging/*shaded*
- uses: actions/upload-artifact@v4
with:
name: Package
path: staging
- name: Create Tag
uses: actions/github-script@v6
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/v${{ steps.release-version.outputs.VERSION }}',
sha: context.sha
})
- name: Release
uses: softprops/action-gh-release@v1
with:
name: JDigitalSimulator v${{ steps.release-version.outputs.VERSION }}
tag_name: ${{ steps.release-version.outputs.VERSION }}
draft: true
files: staging/*
fail_on_unmatched_files: true