Act adjustments (#4961)

* remove trailing whitespace from workflow files

Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>

* skip upload actions when running in act

* https://github.com/nektos/act

Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>
This commit is contained in:
Jamin Collins 2024-04-16 06:14:09 -06:00 committed by GitHub
parent 3acd8a2bb4
commit 98d152a7f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 31 deletions

View file

@ -28,13 +28,13 @@ jobs:
env: env:
date: date:
steps: steps:
# Setup the environment # Setup the environment
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
lfs: 'true' lfs: 'true'
- name: load cached deps - name: load cached deps
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
@ -49,13 +49,13 @@ jobs:
if: inputs.os != 'windows-latest' if: inputs.os != 'windows-latest'
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
shell: bash shell: bash
- name: Get the date on Windows - name: Get the date on Windows
if: inputs.os == 'windows-latest' if: inputs.os == 'windows-latest'
run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
shell: pwsh shell: pwsh
# Build Dependencies # Build Dependencies
- name: Build on Windows - name: Build on Windows
if: inputs.os == 'windows-latest' if: inputs.os == 'windows-latest'
@ -98,8 +98,8 @@ jobs:
./BuildLinux.sh -dr ./BuildLinux.sh -dr
cd deps/build cd deps/build
tar -czvf OrcaSlicer_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir tar -czvf OrcaSlicer_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir
# Upload Artifacts # Upload Artifacts
- name: Upload Mac ${{ inputs.arch }} artifacts - name: Upload Mac ${{ inputs.arch }} artifacts
if: inputs.os == 'macos-12' if: inputs.os == 'macos-12'
@ -116,12 +116,12 @@ jobs:
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip
- name: Upload Ubuntu artifacts - name: Upload Ubuntu artifacts
if: inputs.os == 'ubuntu-20.04' if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' }}
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: OrcaSlicer_dep_ubuntu_${{ env.date }} name: OrcaSlicer_dep_ubuntu_${{ env.date }}
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz
build_orca: build_orca:
name: Build OrcaSlicer name: Build OrcaSlicer
needs: [build_deps] needs: [build_deps]
@ -133,4 +133,3 @@ jobs:
os: ${{ inputs.os }} os: ${{ inputs.os }}
arch: ${{ inputs.arch }} arch: ${{ inputs.arch }}
secrets: inherit secrets: inherit

View file

@ -57,7 +57,7 @@ jobs:
$ref = "${{ github.ref }}" $ref = "${{ github.ref }}"
$eventName = "${{ github.event_name }}" $eventName = "${{ github.event_name }}"
$prNumber = "${{ github.event.number }}" $prNumber = "${{ github.event.number }}"
if ($eventName -eq 'pull_request') { if ($eventName -eq 'pull_request') {
$ver = "PR" + $prNumber $ver = "PR" + $prNumber
} else { } else {
@ -67,12 +67,12 @@ jobs:
} }
$ver = "V$ver" $ver = "V$ver"
} }
echo "ver=$ver" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 echo "ver=$ver" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
echo "date=$date" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 echo "date=$date" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
echo "date: ${{ env.date }} version: ${{ env.ver }}" echo "date: ${{ env.date }} version: ${{ env.ver }}"
shell: pwsh shell: pwsh
# Mac # Mac
- name: Install tools mac - name: Install tools mac
if: inputs.os == 'macos-12' if: inputs.os == 'macos-12'
@ -134,11 +134,11 @@ jobs:
if: github.ref == 'refs/heads/main' && inputs.os == 'macos-12' if: github.ref == 'refs/heads/main' && inputs.os == 'macos-12'
uses: WebFreak001/deploy-nightly@v3.1.0 uses: WebFreak001/deploy-nightly@v3.1.0
with: with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723 release_id: 137995723
asset_path: ${{ github.workspace }}/OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg asset_path: ${{ github.workspace }}/OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
asset_name: OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg asset_name: OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
asset_content_type: application/octet-stream asset_content_type: application/octet-stream
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
# Windows # Windows
@ -174,7 +174,7 @@ jobs:
working-directory: ${{ github.workspace }}/build/src/Release working-directory: ${{ github.workspace }}/build/src/Release
shell: cmd shell: cmd
run: '"C:/Program Files/7-Zip/7z.exe" a -m0=lzma2 -mx9 Debug_PDB_${{ env.ver }}_for_developers_only.7z *.pdb' run: '"C:/Program Files/7-Zip/7z.exe" a -m0=lzma2 -mx9 Debug_PDB_${{ env.ver }}_for_developers_only.7z *.pdb'
- name: Upload artifacts Win zip - name: Upload artifacts Win zip
if: inputs.os == 'windows-latest' if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
@ -200,23 +200,23 @@ jobs:
if: github.ref == 'refs/heads/main' && inputs.os == 'windows-latest' if: github.ref == 'refs/heads/main' && inputs.os == 'windows-latest'
uses: WebFreak001/deploy-nightly@v3.1.0 uses: WebFreak001/deploy-nightly@v3.1.0
with: with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723 release_id: 137995723
asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_${{ env.ver }}_portable.zip asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_${{ env.ver }}_portable.zip
asset_name: OrcaSlicer_Windows_${{ env.ver }}_portable.zip asset_name: OrcaSlicer_Windows_${{ env.ver }}_portable.zip
asset_content_type: application/x-zip-compressed asset_content_type: application/x-zip-compressed
max_releases: 1 max_releases: 1
- name: Deploy Windows release installer - name: Deploy Windows release installer
if: github.ref == 'refs/heads/main' && inputs.os == 'windows-latest' if: github.ref == 'refs/heads/main' && inputs.os == 'windows-latest'
uses: WebFreak001/deploy-nightly@v3.1.0 uses: WebFreak001/deploy-nightly@v3.1.0
with: with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723 release_id: 137995723
asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_Installer_${{ env.ver }}.exe asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_Installer_${{ env.ver }}.exe
asset_name: OrcaSlicer_Windows_Installer_${{ env.ver }}.exe asset_name: OrcaSlicer_Windows_Installer_${{ env.ver }}.exe
asset_content_type: application/x-msdownload asset_content_type: application/x-msdownload
max_releases: 1 max_releases: 1
# Ubuntu # Ubuntu
- name: Install dependencies - name: Install dependencies
@ -257,30 +257,30 @@ jobs:
zip -r orca_custom_preset_tests.zip user/ zip -r orca_custom_preset_tests.zip user/
- name: Upload artifacts Ubuntu - name: Upload artifacts Ubuntu
if: inputs.os == 'ubuntu-20.04' if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' }}
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: OrcaSlicer_Linux_${{ env.ver }} name: OrcaSlicer_Linux_${{ env.ver }}
path: './build/OrcaSlicer_Linux_${{ env.ver }}.AppImage' path: './build/OrcaSlicer_Linux_${{ env.ver }}.AppImage'
- name: Deploy Ubuntu release - name: Deploy Ubuntu release
if: github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-20.04' if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-20.04' }}
uses: WebFreak001/deploy-nightly@v3.1.0 uses: WebFreak001/deploy-nightly@v3.1.0
with: with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723 release_id: 137995723
asset_path: ./build/OrcaSlicer_Linux_${{ env.ver }}.AppImage asset_path: ./build/OrcaSlicer_Linux_${{ env.ver }}.AppImage
asset_name: OrcaSlicer_Linux_${{ env.ver }}.AppImage asset_name: OrcaSlicer_Linux_${{ env.ver }}.AppImage
asset_content_type: application/octet-stream asset_content_type: application/octet-stream
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
- name: Deploy orca_custom_preset_tests - name: Deploy orca_custom_preset_tests
if: github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-20.04' if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-20.04' }}
uses: WebFreak001/deploy-nightly@v3.1.0 uses: WebFreak001/deploy-nightly@v3.1.0
with: with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label} upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723 release_id: 137995723
asset_path: ${{ github.workspace }}/resources/profiles/orca_custom_preset_tests.zip asset_path: ${{ github.workspace }}/resources/profiles/orca_custom_preset_tests.zip
asset_name: orca_custom_preset_tests.zip asset_name: orca_custom_preset_tests.zip
asset_content_type: application/octet-stream asset_content_type: application/octet-stream
max_releases: 1 max_releases: 1

View file

@ -16,6 +16,7 @@ env:
jobs: jobs:
publish_docs_to_wiki: publish_docs_to_wiki:
if: ${{ !env.ACT }} # Skip if using `act`
name: Publish docs to Wiki name: Publish docs to Wiki
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps: