Skip to content

CI: Added create-release.yml #108

CI: Added create-release.yml

CI: Added create-release.yml #108

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Build and Package Drifty
on:
push:
branches: [ "master" ]
paths-ignore:
- "Website/**"
- "*.md"
- "*.txt"
pull_request:
branches: [ "master" ]
paths-ignore:
- "Website/**"
- "*.md"
- "*.txt"
workflow_dispatch:
workflow_call:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
package-Drifty:
strategy:
matrix:
os: ["windows-latest", "macos-latest", "ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up JDK 20
uses: actions/setup-java@v3
with:
java-version: '20.0.1'
distribution: 'oracle'
cache: maven
- name: Build with Maven for ${{ matrix.os }}
run: mvn compile
- name: Package Drifty CLI for ${{ matrix.os }} with JavaPackager Maven plugin
run: mvn javapackager:package@bundling-Drifty-CLI-for-${{ matrix.os }}
- name: Package Drifty GUI for ${{ matrix.os }} with JavaPackager Maven plugin
run: mvn javapackager:package@bundling-Drifty-GUI-for-${{ matrix.os }}
- name: Push generated artifacts for ${{ matrix.os }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-Build-Files
path: target
release-Drifty:
if: github.event_name == 'workflow_call'
runs-on: ubuntu-latest
needs: package-Drifty
steps:
- uses: actions/checkout@v3
- name: Get Drifty version from .version file
run: echo "VERSION=$(cat .version)" >> $GITHUB_ENV
- name: Set Drifty version in pom.xml
run: mvn versions:set -DnewVersion=$VERSION
- name: Download Build artifacts
uses: actions/download-artifact@v3
- name: Create Release ($VERSION) with automated release notes
run: gh release create v$VERSION --generate-notes '/path/to/asset.extension#Asset-Display-Name' # Assets path to be added later