Test. #288
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: | |
build: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: cmd | |
steps: | |
- name: Clone. | |
uses: actions/checkout@v1 | |
- uses: actions/setup-java@main | |
name: Install Java 17. | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Set up version of Chatty. | |
run: | | |
git checkout test_ci | |
git remote add upstream https://github.com/chatty/chatty | |
git fetch --all | |
git branch master --set-upstream-to upstream/master | |
git status | |
git status > 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/* | |
build_mac_arm: | |
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: Set up version of Chatty | |
run: | | |
git checkout test_ci | |
- 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: | |
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: Set up version of Chatty | |
run: | | |
git checkout test_ci | |
- 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: Latest chatty tag. | |
shell: bash | |
run: | | |
curl \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
https://api.github.com/repos/chatty/chatty/releases > latest_chatty.json | |
- name: Parse JSON. | |
shell: python | |
run: | | |
import json | |
import os | |
def writeEnv(key, value): | |
open(os.environ['GITHUB_ENV'], "a").write(key + '=' + value + '\n'); | |
with open('latest_chatty.json') as json_data: | |
data = json.load(json_data)[0]; | |
tag_name = str(data['tag_name']); | |
writeEnv('CHATTY_TAG', tag_name); | |
tag_text = tag_name.replace('-b', ' Beta ').replace('v', ''); | |
writeEnv('CHATTY_TAG_TEXT', tag_text); | |
print(tag_name); | |
print(tag_text); | |
with open('final_version.txt') as ver_data: | |
writeEnv('NEW_TAG_TEXT', str(ver_data.read())); | |
- name: Get version info | |
shell: bash | |
run: | | |
echo "NEW_TAG_TEXT=$(cat final_version.txt)" >> $GITHUB_ENV | |
curl \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
https://api.github.com/repos/chatty/chatty/releases > latest_chatty.json | |
CHATTY_TAG=$(jq -r '.[0].tag_name' latest_chatty.json) | |
CHATTY_TAG_TEXT=$(echo $CHATTY_TAG | sed 's/-b/ Beta /' | sed 's/v//') | |
echo "CHATTY_TAG=$CHATTY_TAG" >> $GITHUB_ENV | |
echo "CHATTY_TAG_TEXT=$CHATTY_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${{ env.NEW_TAG_TEXT }} | |
name: "Chatty Fork ${{ env.NEW_TAG_TEXT }}" | |
body: "- Updated version to official [${{ env.CHATTY_TAG_TEXT }}](https://github.com/chatty/chatty/releases/tag/${{ env.CHATTY_TAG }})." | |
env: | |
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} |