doc #75
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
name: Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: windows-latest | |
permissions: | |
# write permission is required to create a github release | |
contents: write | |
# write permission is required for autolabeler | |
# otherwise, read permission is required at least | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Corretto JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'corretto' | |
java-version: '11' | |
cache: 'maven' | |
- name: Cache local Maven repository | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: List files in the repository | |
run: | | |
ls ${{ github.workspace }} | |
- name: Build with Maven | |
run: mvn --batch-mode --update-snapshots clean package -DskipTests | |
- name: List files in the Output folder | |
run: | | |
ls ${{ github.workspace }}/Output/VPin-Studio/ | |
- name: Set Release Version | |
id: set-release-version | |
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' | |
run: | | |
$version = mvn "--batch-mode" org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate "-Dexpression=project.version" "-q" "-DforceStdout" | |
echo "::set-output name=version::${version}" | |
- name: Draft Release | |
uses: softprops/action-gh-release@v1 | |
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' | |
with: | |
body_path: RELEASE_NOTES.md | |
draft: true | |
tag_name: ${{ steps.set-release-version.outputs.version }} | |
files: | | |
./Output/VPin-Studio/VPin-Studio-Client-Installer*.exe | |
./Output/VPin-Studio/VPin-Studio-Full-Installer*.exe | |
./Output/VPin-Studio/VPin-Studio-Server.zip | |
./Output/VPin-Studio/VPin-Studio.zip | |
./Output/VPin-Studio/VPin-Studio-Client.zip | |
env: | |
GITHUB_REPOSITORY: https://github.com/syd711/vpin-studio |