Add pre-dev publishing to Actions workflows

This commit is contained in:
Lawrence Lee 2023-03-19 15:37:33 -07:00
parent 69c1caafa1
commit cfabedc4e9
No known key found for this signature in database
GPG Key ID: 048FF2B76A63895F
2 changed files with 75 additions and 0 deletions

View File

@ -10,6 +10,8 @@ on:
branches:
- dev
workflow_dispatch:
env:
publish_pre_dev_labels: '[]'
jobs:
build:
runs-on: ubuntu-18.04
@ -167,3 +169,33 @@ jobs:
files: |
${{env.PUBLISH_NAME}}.AppImage
${{env.PUBLISH_NAME}}-AboutThisBuild.txt
- name: Prepare for publishing pre-dev
id: prepare-publish-pre-dev
if: ${{github.event_name == 'pull_request' && contains(fromJSON(env.publish_pre_dev_labels), github.event.pull_request.head.label)}}
run: |
echo "Making ref name."
REF_NAME_FILTERED="$(echo '${{github.event.pull_request.head.label}}' | tr ':' '_' | sed 's/[^A-z0-9_.-]//g')"
echo "Ref name is '$REF_NAME_FILTERED'."
echo "Setting publish name."
PUBLISH_NAME="RawTherapee_${REF_NAME_FILTERED}_${{matrix.build_type}}"
echo "Publish name is '$PUBLISH_NAME'."
echo "Renaming AppImage."
cp "build/$ARTIFACT_NAME.AppImage" "$PUBLISH_NAME.AppImage"
echo "Creating version file."
cp "build/AboutThisBuild.txt" "$PUBLISH_NAME-AppImage-AboutThisBuild.txt"
echo "Recording publish name."
echo "PUBLISH_NAME=$PUBLISH_NAME" >> $GITHUB_ENV
- name: Publish pre-dev artifacts
uses: softprops/action-gh-release@v1
if: ${{steps.prepare-publish-pre-dev.outcome == 'success'}}
with:
tag_name: pre-dev-github-actions
files: |
${{env.PUBLISH_NAME}}.AppImage
${{env.PUBLISH_NAME}}-AppImage-AboutThisBuild.txt

View File

@ -10,6 +10,8 @@ on:
branches:
- dev
workflow_dispatch:
env:
publish_pre_dev_labels: '[]'
jobs:
build:
runs-on: windows-2022
@ -300,3 +302,44 @@ jobs:
with:
tag_name: nightly-github-actions
files: build/${{env.PUBLISH_NAME}}.exe
- name: Prepare for publishing pre-dev
id: prepare-publish-pre-dev
if: ${{github.event_name == 'pull_request' && contains(fromJSON(env.publish_pre_dev_labels), github.event.pull_request.head.label)}}
run: |
echo "Making ref name."
REF_NAME_FILTERED="$(echo '${{github.event.pull_request.head.label}}' | tr ':' '_' | sed 's/[^A-z0-9_.-]//g')"
echo "Ref name is '$REF_NAME_FILTERED'."
echo "Setting publish name."
PUBLISH_NAME="RawTherapee_${REF_NAME_FILTERED}_win64_${{matrix.build_type}}"
echo "Publish name is '$PUBLISH_NAME'."
if [ "$ARTIFACT_NAME" != "$PUBLISH_NAME" ]; then
echo "Renaming ZIP file."
cp "build/$ARTIFACT_NAME.zip" "build/$PUBLISH_NAME.zip"
if [ -e "./build/$ARTIFACT_NAME.exe" ]; then
echo "Renaming installer."
mv "./build/$ARTIFACT_NAME.exe" "./build/$PUBLISH_NAME.exe"
fi
fi
echo "Creating version file."
cp "build/$ARTIFACT_NAME/AboutThisBuild.txt" "build/$PUBLISH_NAME-AboutThisBuild.txt"
echo "Recording publish name."
echo "PUBLISH_NAME=$PUBLISH_NAME" >> "$(cygpath -u $GITHUB_ENV)"
- name: Publish pre-dev artifacts
uses: softprops/action-gh-release@v1
if: ${{steps.prepare-publish-pre-dev.outcome == 'success'}}
with:
tag_name: pre-dev-github-actions
files: |
build/${{env.PUBLISH_NAME}}.zip
build/${{env.PUBLISH_NAME}}-AboutThisBuild.txt
- name: Publish pre-dev installer
uses: softprops/action-gh-release@v1
if: ${{steps.prepare-publish-pre-dev.outcome == 'success' && matrix.build_type == 'release'}}
with:
tag_name: pre-dev-github-actions
files: build/${{env.PUBLISH_NAME}}.exe