#v0.3.6 release - fixed application crash at launch due to broken vat… #191
This file contains hidden or 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: | |
| - 'master' | |
| - 'releases/**' | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| if: ${{ !contains(github.event.head_commit.message, '#no-build') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Create short SHA | |
| uses: benjlevesque/short-sha@v1.2 | |
| id: short-sha | |
| with: | |
| length: 6 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: adopt | |
| java-version: 15 | |
| - name: Master Version | |
| if: github.ref == 'refs/heads/master' | |
| run: | | |
| $version = $(mvn -q -DforceStdout org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression="project.version") | |
| echo "Version: ${version}" | |
| echo "PROJECT_VERSION=$version" >> $env:GITHUB_ENV | |
| echo "${version}" | Out-File PROJECT_VERSION.var -NoNewline | |
| echo "unused" | Out-File PROJECT_VERSION_TAG_PRERELEASE.var -NoNewline | |
| - name: Branch Version | |
| if: github.ref != 'refs/heads/master' | |
| run: | | |
| $current_branch = $(git branch --show-current) | |
| echo "Current Branch: ${current_branch}" | |
| $current_version_stub = ${current_branch} | Select-String -Pattern 'releases/(\d\.\d\.\d)' | % {$($_.matches.groups[1].value)} | |
| echo "Current Version Stub: ${current_version_stub}" | |
| echo "PROJECT_VERSION_TAG_PRERELEASE=$current_version_stub" >> $env:GITHUB_ENV | |
| $branch_commit = $(git rev-list --all -1 --grep=#v${current_version_stub}) | |
| echo "Branch Commit: ${branch_commit}" | |
| $build_number = $(git rev-list --count "${branch_commit}..") | |
| echo "Build Number: ${build_number}" | |
| $commit_message = $(git log --format=%B -n 1 ${branch_commit}) | |
| echo "Commit Message: ${commit_message}" | |
| $current_version = ${commit_message} | Select-String -Pattern '(:?#v(\d\.\d\.\d[^\s]*))' | % {$($_.matches.groups[2].value)} | |
| echo "Current Version: ${current_version}" | |
| $version = "${current_version}.$([int]${build_number}+1)" | |
| echo "Version: ${version}" | |
| echo "PROJECT_VERSION=$version" >> $env:GITHUB_ENV | |
| echo "${current_version_stub}" | Out-File PROJECT_VERSION_TAG_PRERELEASE.var -NoNewline | |
| echo "${version}" | Out-File PROJECT_VERSION.var -NoNewline | |
| - name: Download WiX Toolset | |
| run: Invoke-WebRequest https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip -OutFile wix.zip | |
| - name: Unzip WiX Toolset | |
| run: mkdir wix; tar -xf wix.zip -C wix | |
| - name: Install WiX Toolset | |
| run: echo wix | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| - name: Maven Build | |
| run: mvn --batch-mode --update-snapshots verify "-DversionName=${{env.PROJECT_VERSION}}+${{steps.short-sha.outputs.sha}}.win64" "-DbuildNumber=${{github.run_number}}" | |
| - name: Rename artifacts | |
| run: ren target-installer/VATprism-${{github.run_number}}.0.0.msi VATprism-${{env.PROJECT_VERSION}}.msi; | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows | |
| path: | | |
| target-installer/* | |
| LICENSE | |
| - name: Upload Vars | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vars | |
| path: ./*.var | |
| build-osx: | |
| runs-on: macos-latest | |
| needs: build-windows | |
| if: ${{ !contains(github.event.head_commit.message, '#no-build') }} | |
| steps: | |
| - name: Download Vars | |
| uses: actions/download-artifact@v2 | |
| with: | |
| name: vars | |
| - name: Read Vars | |
| run: | | |
| echo "PROJECT_VERSION=$(cat PROJECT_VERSION.var)" >> $GITHUB_ENV | |
| echo "PROJECT_VERSION_TAG_PRERELEASE=$(cat PROJECT_VERSION_TAG_PRERELEASE.var)" >> $GITHUB_ENV | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Create short SHA | |
| uses: benjlevesque/short-sha@v1.2 | |
| id: short-sha | |
| with: | |
| length: 6 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: adopt | |
| java-version: 15 | |
| - name: Maven Build | |
| run: mvn --batch-mode --update-snapshots verify "-DversionName=${{env.PROJECT_VERSION}}+${{steps.short-sha.outputs.sha}}.macos" "-DbuildNumber=${{github.run_number}}" | |
| - name: Rename artifacts | |
| run: mv target-installer/VATprism-${{github.run_number}}.0.0.dmg target-installer/VATprism-${{env.PROJECT_VERSION}}.dmg; | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos | |
| path: target-installer/* | |
| release: | |
| runs-on: windows-latest | |
| if: ${{ !contains(github.event.head_commit.message, '#no-build') }} | |
| needs: [ build-windows, build-osx ] | |
| steps: | |
| - name: Download Windows Artifacts | |
| uses: actions/download-artifact@v2 | |
| with: | |
| name: windows | |
| - name: Download macOS Artifacts | |
| uses: actions/download-artifact@v2 | |
| with: | |
| name: macos | |
| path: target-installer/ | |
| - name: Download Vars | |
| uses: actions/download-artifact@v2 | |
| with: | |
| name: vars | |
| - run: ls | |
| - name: Read Vars | |
| run: | | |
| echo ls | |
| echo "PROJECT_VERSION=$(cat PROJECT_VERSION.var)" >> $env:GITHUB_ENV | |
| echo "PROJECT_VERSION_TAG_PRERELEASE=$(cat PROJECT_VERSION_TAG_PRERELEASE.var)" >> $env:GITHUB_ENV | |
| - name: Master Release | |
| uses: marvinpinto/action-automatic-releases@latest | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| repo_token: ${{secrets.GITHUB_TOKEN}} | |
| automatic_release_tag: v${{env.PROJECT_VERSION}} | |
| prerelease: false | |
| title: v${{env.PROJECT_VERSION}} | |
| files: | | |
| target-installer/* | |
| LICENSE | |
| - name: Branch Release | |
| uses: marvinpinto/action-automatic-releases@latest | |
| if: github.ref != 'refs/heads/master' | |
| with: | |
| repo_token: ${{secrets.GITHUB_TOKEN}} | |
| automatic_release_tag: v${{env.PROJECT_VERSION_TAG_PRERELEASE}} | |
| prerelease: true | |
| title: v${{env.PROJECT_VERSION}} | |
| files: | | |
| target-installer/* | |
| LICENSE | |
| deploy-pages: | |
| if: | |
| github.ref == 'refs/heads/master' | |
| needs: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger GitHub pages rebuild | |
| run: curl -u marvk:${{secrets.PAGES_BUILD_KEY}} -X POST https://api.github.com/repos/${{ github.repository }}/pages/builds |