Test. #291
Workflow file for this run
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: Java CI | |
on: [push] | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
outputs: | |
ch_content: ${{ steps.prepare_ch.outputs.CH_CONTENT }} | |
steps: | |
- name: Clone | |
uses: actions/checkout@v1 | |
- name: Prepare ch.txt content | |
id: prepare_ch | |
run: | | |
git checkout test_ci | |
git remote add upstream https://github.com/chatty/chatty | |
git fetch --all | |
git branch test_ci --set-upstream-to upstream/master | |
status_output=$(git status) | |
echo "::set-output name=CH_CONTENT::$status_output" | |
build: | |
needs: prepare | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: cmd | |
outputs: | |
new_tag_text: ${{ steps.set_version.outputs.NEW_TAG_TEXT }} | |
steps: | |
- name: Clone | |
uses: actions/checkout@v1 | |
- uses: actions/setup-java@main | |
name: Install Java 17 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Create ch.txt and run version.py | |
run: | | |
echo "${{ needs.prepare.outputs.ch_content }}" > ch.txt | |
python version.py | |
- name: Build with Gradle | |
run: | | |
gradlew build ^ | |
&& gradlew release ^ | |
&& gradlew ^ | |
releaseWinSetups ^ | |
-PjpackagePath="%java_home%\bin\jpackage.exe" ^ | |
-PinnosetupPath="%programfiles(x86)%\Inno Setup 6\ISCC.exe" ^ | |
-PmtPath="%programfiles(x86)%\Windows Kits\10\bin\10.0.22000.0\x64\mt.exe" | |
- name: Upload Windows Artifacts | |
uses: actions/[email protected] | |
with: | |
name: windows-artifacts | |
path: build/releases/* | |
- name: Get new tag text | |
id: set_version | |
run: | | |
set /p new_tag_text=<final_version.txt | |
echo "::set-output name=NEW_TAG_TEXT::%new_tag_text%" | |
build_mac_arm: | |
needs: prepare | |
runs-on: macos-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Clone | |
uses: actions/checkout@v1 | |
- name: Set up JDK (ARM64) | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
architecture: arm64 | |
- name: Create ch.txt and run version.py | |
run: | | |
echo "${{ needs.prepare.outputs.ch_content }}" > ch.txt | |
python version.py | |
- name: Build with Gradle (ARM64) | |
run: | | |
./gradlew build && \ | |
./gradlew release && \ | |
./gradlew jpackageMacArm -PjpackagePath=`which jpackage` | |
- name: Upload Mac ARM Artifacts | |
uses: actions/[email protected] | |
with: | |
name: mac-arm-artifacts | |
path: build/jpackage-mac/* | |
build_mac_intel: | |
needs: prepare | |
runs-on: macos-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Clone | |
uses: actions/checkout@v1 | |
- name: Set up JDK (x64) | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
architecture: x64 | |
- name: Create ch.txt and run version.py | |
run: | | |
echo "${{ needs.prepare.outputs.ch_content }}" > ch.txt | |
python version.py | |
- name: Build with Gradle (x64) | |
run: | | |
./gradlew build && \ | |
./gradlew release && \ | |
./gradlew jpackageMacIntel -PjpackagePath=`which jpackage` | |
- name: Upload Mac Intel Artifacts | |
uses: actions/[email protected] | |
with: | |
name: mac-intel-artifacts | |
path: build/jpackage-mac/* | |
create_release: | |
needs: [build, build_mac_arm, build_mac_intel] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Windows Artifacts | |
uses: actions/[email protected] | |
with: | |
name: windows-artifacts | |
path: artifacts/windows | |
- name: Download Mac ARM Artifacts | |
uses: actions/[email protected] | |
with: | |
name: mac-arm-artifacts | |
path: artifacts/mac-arm | |
- name: Download Mac Intel Artifacts | |
uses: actions/[email protected] | |
with: | |
name: mac-intel-artifacts | |
path: artifacts/mac-intel | |
- name: Fetch latest Chatty tag | |
run: | | |
curl \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
https://api.github.com/repos/chatty/chatty/releases > latest_chatty.json | |
- name: Parse JSON and set variables | |
id: set_version | |
run: | | |
tag_name=$(jq -r '.[0].tag_name' latest_chatty.json) | |
tag_text=$(echo $tag_name | sed 's/-b/ Beta /' | sed 's/v//') | |
echo "CHATTY_TAG=$tag_name" >> $GITHUB_ENV | |
echo "CHATTY_TAG_TEXT=$tag_text" >> $GITHUB_ENV | |
- name: Create Release | |
uses: softprops/[email protected] | |
with: | |
draft: true | |
files: | | |
artifacts/windows/* | |
artifacts/mac-arm/* | |
artifacts/mac-intel/* | |
tag_name: v${{ needs.build.outputs.new_tag_text }} | |
name: "Chatty Fork ${{ needs.build.outputs.new_tag_text }}" | |
body: | | |
- Updated version to official [$CHATTY_TAG_TEXT](https://github.com/chatty/chatty/releases/tag/$CHATTY_TAG). | |
- Includes builds for Windows, macOS ARM64, and macOS x64. | |
env: | |
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} |