Update release instructions #75
Workflow file for this run
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: Releases | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
windows: | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 17 | |
- name: Gradle caching | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Package Windows ".msi" distribution | |
run: ./gradlew :desktop:packageReleaseMsi | |
- name: Rename Artifact | |
shell: cmd | |
run: | | |
setlocal enabledelayedexpansion | |
set "pattern=hammer-*.msi" | |
set "newName=hammer.msi" | |
set "foundFile=" | |
for /r %%i in (%pattern%) do ( | |
set "foundFile=%%i" | |
) | |
if defined foundFile ( | |
echo Renaming !foundFile! to %newName% | |
ren "!foundFile!" "%newName%" | |
) else ( | |
echo No file matching pattern found. | |
) | |
endlocal | |
echo Successfully renamed file to "hammer.msi" | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
draft: true | |
prerelease: true | |
artifactErrorsFailBuild: true | |
allowUpdates: true | |
artifacts: "D:\\a\\hammer-editor\\hammer-editor\\desktop\\build\\installers\\main-release\\msi\\hammer.msi" | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 17 | |
- name: Gradle caching | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Package Linux ".deb" distribution | |
run: ./gradlew :desktop:packageReleaseDeb | |
- name: Rename Artifact | |
run: | | |
cd /home/runner/work/hammer-editor/hammer-editor/desktop/build/installers/main-release/deb/ | |
# find the file matching the pattern and store its name in a variable | |
file=$(find . -type f -name 'hammer_*.deb' -print -quit) | |
# if no file was found, exit with an error message | |
if [ -z "$file" ]; then | |
echo "Error: no file matching the pattern found." | |
exit 1 | |
fi | |
# rename the file to "hammer.deb" | |
mv "$file" "${file/hammer_*/hammer}.deb" | |
echo "File renamed successfully." | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
draft: true | |
prerelease: true | |
artifactErrorsFailBuild: true | |
allowUpdates: true | |
artifacts: "/home/runner/work/hammer-editor/hammer-editor/desktop/build/installers/main-release/deb/hammer.deb" | |
macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 17 | |
- name: Gradle caching | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Package MacOS ".dmg" distribution | |
run: ./gradlew :desktop:packageReleaseDmg | |
- name: Rename Artifact | |
run: | | |
cd /Users/runner/work/hammer-editor/hammer-editor/desktop/build/installers/main-release/dmg/ | |
# find the file matching the pattern and store its name in a variable | |
file=$(find . -type f -name 'hammer-*.dmg' -print -quit) | |
# if no file was found, exit with an error message | |
if [ -z "$file" ]; then | |
echo "Error: no file matching the pattern found." | |
exit 1 | |
fi | |
# rename the file to "hammer.dmg" | |
mv "$file" "${file/hammer-*/hammer}.dmg" | |
echo "File renamed successfully." | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
draft: true | |
prerelease: true | |
artifactErrorsFailBuild: true | |
allowUpdates: true | |
artifacts: "/Users/runner/work/hammer-editor/hammer-editor/desktop/build/installers/main-release/dmg/hammer.dmg" | |
server: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 17 | |
- name: Gradle caching | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Package Server distributions | |
run: ./gradlew :server:assembleDist | |
- name: Rename tar Artifact | |
run: | | |
file=$(find . -type f -name 'server-*.tar' -print -quit) | |
if [ -z "$file" ]; then | |
echo "Error: no file matching the pattern found." | |
exit 1 | |
fi | |
mv "$file" "${file/server-*/server}.tar" | |
echo "File renamed successfully." | |
- name: Rename zip Artifact | |
run: | | |
file=$(find . -type f -name 'server-*.zip' -print -quit) | |
if [ -z "$file" ]; then | |
echo "Error: no file matching the pattern found." | |
exit 1 | |
fi | |
mv "$file" "${file/server-*/server}.zip" | |
echo "File renamed successfully." | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
draft: true | |
prerelease: true | |
artifactErrorsFailBuild: true | |
allowUpdates: true | |
artifacts: "/home/runner/work/hammer-editor/hammer-editor/server/build/distributions/*.*" | |
android: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 17 | |
- name: Gradle caching | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Restore key | |
working-directory: /home/runner/work/hammer-editor/hammer-editor/ | |
run: | | |
echo "${{ secrets.RELEASE_KEYSTORE }}" > release.keystore.asc | |
echo ${{ secrets.RELEASE_STORE_PASSWORD_BASE64 }} | base64 -d > passphrase | |
gpg -d --passphrase-file passphrase --batch release.keystore.asc > release.keystore | |
- name: Build APK | |
env: | |
RELEASE_STORE_FILE: /home/runner/work/hammer-editor/hammer-editor/release.keystore | |
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }} | |
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }} | |
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | |
run: | | |
./gradlew :android:assembleRelease | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
draft: true | |
prerelease: true | |
artifactErrorsFailBuild: true | |
allowUpdates: true | |
artifacts: "/home/runner/work/hammer-editor/hammer-editor/android/build/outputs/apk/release/*.apk" |