Skip to content

Update maven-publish.yml #13

Update maven-publish.yml

Update maven-publish.yml #13

Workflow file for this run

# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Maven Package
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Set version env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
- name: Set Maven package versions
run: mvn org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=${RELEASE_VERSION}
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Create release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
file: "sleec-product/target/products/*.tar.gz;sleec-product/target/products/*.zip"
tags: true
draft: true
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add SSH known hosts
run: echo "${ROBOSTAR_WEB_HOST} ${ROBOSTAR_WEB_SSH_FINGERPRINT_TYPE} ${ROBOSTAR_WEB_SSH_FINGERPRINT}" >> ~/.ssh/known_hosts
env:
ROBOSTAR_WEB_HOST: ${{ secrets.ROBOSTAR_WEB_HOST }}
ROBOSTAR_WEB_SSH_FINGERPRINT: ${{ secrets.ROBOSTAR_WEB_SSH_FINGERPRINT }}
ROBOSTAR_WEB_SSH_FINGERPRINT_TYPE: ${{ secrets.ROBOSTAR_WEB_SSH_FINGERPRINT_TYPE }}
- id: deploy
name: Deploy
uses: UoY-RoboStar/ga-eclipse-deploy@master
with:
remote-host: ${{ secrets.ROBOSTAR_WEB_HOST }}
remote-user: ${{ secrets.ROBOSTAR_WEB_USER }}
remote-root: ${{ secrets.ROBOSTAR_WEB_ROOT }}
remote-baseurl: 'https://robostar.cs.york.ac.uk'
remote-relative-path: 'robotool/sleec-core/'
maven-target: 'sleec-core/circus.robocalc.sleec.repository/target/repository/'
- name: Create commit comment
uses: peter-evans/commit-comment@v1
with:
body: 'Successfully deployed at: https://robostar.cs.york.ac.uk/robotool/sleec-core/${{ steps.deploy.outputs.dest }}'