CreateRelease #19
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: CreateRelease | |
on: | |
#[push, pull_request] #just for test release scripts | |
workflow_dispatch: #manual run | |
inputs: | |
version: | |
description: 'New Relight Version' | |
required: true | |
default: 'YYYY.MM' | |
env: | |
QT_VERSION: '6.6.*' | |
jobs: | |
update_rl_version: | |
name: Update RELIGHT_VERSION | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Update Relight version | |
run : | | |
echo ${{ github.event.inputs.version }} | tr -d '\n'> RELIGHT_VERSION | |
- name: commit RELIGHT_VERSION change | |
uses: EndBug/add-and-commit@v9 | |
with: | |
committer_name: GitHub Actions | |
committer_email: [email protected] | |
message: Set Relight version to ${{ github.event.inputs.version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
relight_build: | |
needs: [update_rl_version] | |
name: Build RelightLab | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ['ubuntu-20.04', 'macos-latest', 'windows-latest'] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
ref: master | |
- name: Setup MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Set CodeSign Certificate macOS | |
if: runner.os == 'macOS' | |
uses: apple-actions/import-codesign-certs@v2 | |
with: | |
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }} | |
p12-password: ${{ secrets.MACOS_CERTIFICATE_PSSW }} | |
- name: Set CodeSign Certificate Windows | |
if: runner.os == 'Windows' | |
run: | | |
New-Item -ItemType directory -Path certificate | |
Set-Content -Path certificate\certificate.txt -Value '${{ secrets.WIN_CERTIFICATE }}' | |
certutil -decode certificate\certificate.txt certificate\certificate.pfx | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v4 | |
with: | |
cache: 'true' | |
version: ${{ env.QT_VERSION }} | |
- name: Install dependencies | |
shell: bash | |
run: | | |
bash build_scripts/${{ runner.os }}/0_setup_env.sh --dont_install_qt | |
- name: Ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ${{ runner.os }}-${{ github.ref }} | |
- name: Configure and Build | |
shell: bash | |
run: | | |
bash build_scripts/${{ runner.os }}/1_build.sh --ccache | |
- name: Deploy | |
shell: bash | |
run: | | |
bash build_scripts/${{ runner.os }}/2_deploy.sh --cert_pssw='${{ secrets.WIN_CERTIFICATE_PSSW }}' --cert_id='${{ secrets.MACOS_CERT_ID }}' --notarization_user='${{ secrets.MACOS_NOTARIZATION_USER }}' --notarization_team='${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}' --notarization_pssw='${{ secrets.MACOS_NOTARIZATION_PSSW }}' | |
- name: Upload RelightLab Portable | |
uses: actions/upload-artifact@v4 | |
with: | |
name: RelightLab_${{ runner.os }}_portable | |
path: install/ | |
- name: Upload RelightLab Packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: RelightLab_${{ runner.os }}_packages | |
path: packages/RelightLab* | |
#after building RelightLab for the three platforms, we create a release in github | |
create_release: | |
name: Create Release | |
needs: [relight_build] | |
runs-on: ubuntu-latest | |
steps: | |
#Download Linux Packages | |
- name: Download Linux ZIP | |
uses: actions/download-artifact@v4 | |
with: | |
name: RelightLab_Linux_portable | |
path: relightlab_linux_portable | |
- name: Download Linux AppImage | |
uses: actions/download-artifact@v4 | |
with: | |
name: RelightLab_Linux_packages | |
path: relightlab_linux_appimage | |
- name: Change Permissions | |
run: | | |
chmod +x relightlab_linux_portable/usr/bin/relight | |
chmod +x relightlab_linux_portable/usr/bin/relight-cli | |
chmod +x relightlab_linux_portable/usr/bin/relight-merge | |
chmod +x relightlab_linux_portable/AppRun | |
- name: Setup env variables | |
id: envs | |
shell: bash | |
run: | | |
sudo apt-get install -y mesa-common-dev libglu1-mesa-dev freeglut3-dev | |
#get version of relightlab | |
IFS=' ' #space delimiter | |
STR_VERSION=$(relightlab_linux_portable/usr/bin/relight --version) | |
read -a strarr <<< "$STR_VERSION" | |
RL_VERSION=${strarr[1]} #get the relight version from the string | |
echo "rl_version=$RL_VERSION" >> $GITHUB_OUTPUT | |
- name: Create RelightLab Portable Linux Archive | |
run: | | |
cd relightlab_linux_portable | |
tar -cvzf ../RelightLab${{steps.envs.outputs.rl_version}}-linux.tar.gz * | |
cd .. | |
#Download MacOS Package | |
- name: Download MacOS DMG | |
uses: actions/download-artifact@v4 | |
with: | |
name: RelightLab_macOS_packages | |
path: relightlab_macos_dmg | |
- name: Download MacOS Portable | |
uses: actions/download-artifact@v4 | |
with: | |
name: RelightLab_macOS_portable | |
path: relightlab_macos_portable | |
- name: Change Permissions | |
run: | | |
chmod +x relightlab_macos_portable/RelightLab*.app/Contents/MacOS/relight | |
chmod +x relightlab_macos_portable/RelightLab*.app/Contents/MacOS/relight-cli | |
chmod +x relightlab_macos_portable/RelightLab*.app/Contents/MacOS/relight-merge | |
- name: Create RelightLab Portable MacOS | |
run: | | |
cd relightlab_macos_portable | |
tar -cvzf ../RelightLab${{steps.envs.outputs.rl_version}}-macos.tar.gz * | |
cd .. | |
#Download Windows Packages | |
- name: Download Windows ZIP | |
uses: actions/download-artifact@v4 | |
with: | |
name: RelightLab_Windows_portable | |
path: relightlab_windows_portable | |
# - name: Download Windows Installer | |
# uses: actions/download-artifact@v4 | |
# with: | |
# name: RelightLab_Windows_packages | |
# path: relightlab_windows_installer | |
- name: Create RelightLab Portable Windows Archive | |
run: | | |
cd relightlab_windows_portable | |
zip -r ../RelightLab${{steps.envs.outputs.rl_version}}-windows.zip * | |
cd .. | |
#Create release and upload | |
- uses: "ncipollo/release-action@v1" | |
with: | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
tag: "RelightLab-${{steps.envs.outputs.rl_version}}" | |
name: "RelightLab-${{steps.envs.outputs.rl_version}}" | |
artifacts: | | |
RelightLab${{steps.envs.outputs.rl_version}}-linux.tar.gz | |
relightlab_linux_appimage/RelightLab${{steps.envs.outputs.rl_version}}-linux.AppImage | |
RelightLab${{steps.envs.outputs.rl_version}}-macos.tar.gz | |
relightlab_macos_dmg/RelightLab${{steps.envs.outputs.rl_version}}-macos.dmg | |
RelightLab${{steps.envs.outputs.rl_version}}-windows.zip | |
# relightlab_windows_installer/RelightLab${{steps.envs.outputs.rl_version}}-windows.exe |