[feature/manifest-updatecautionmessage] Packaging #26
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: Package | |
| on: | |
| pull_request: | |
| types: | |
| - labeled | |
| - unlabeled | |
| - opened | |
| - edited | |
| - reopened | |
| - synchronize | |
| workflow_call: | |
| inputs: | |
| branch-name: | |
| required: true | |
| type: string | |
| workflow_dispatch: | |
| inputs: | |
| branch-name: | |
| required: true | |
| type: string | |
| env: | |
| OUTPUT_PATH_WINDOWS: published/windows | |
| OUTPUT_PATH_LINUX: published/linux | |
| OUTPUT_PATH_MAC: published/mac | |
| CONFIGURATION: Release | |
| WORKING_DIRECTORY: "Stardrop" | |
| BRANCH: ${{ github.event_name != 'pull_request' && inputs.branch-name || github.event.pull_request.head.ref }} | |
| run-name: "[${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || 'Default Branch' }}] Packaging" | |
| jobs: | |
| package-macos: | |
| if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'generate packages') | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ env.BRANCH }} | |
| repository: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }} | |
| - run: mkdir -p path/to/release-artifacts | |
| - name: Publish (MacOS - Creating) | |
| run: | | |
| mkdir -p "${{ env.OUTPUT_PATH_MAC }}/Stardrop.app/Contents/MacOS" | |
| mkdir -p "${{ env.OUTPUT_PATH_MAC }}/Stardrop.app/Contents/Resources" | |
| dotnet publish "${{ env.WORKING_DIRECTORY }}" --output "${{ env.OUTPUT_PATH_MAC }}/Stardrop.app/Contents/MacOS" --configuration "${{ env.CONFIGURATION }}" --runtime "osx-x64" --framework "net8.0" --self-contained | |
| - name: Publish (MacOS - Packaging) | |
| working-directory: "${{ env.OUTPUT_PATH_MAC }}/Stardrop.app" | |
| run: | | |
| cp ${GITHUB_WORKSPACE}/Stardrop/Assets/Info.plist "Contents/Info.plist" | |
| cp ${GITHUB_WORKSPACE}/Stardrop/Assets/Stardrop.icns "Contents/Resources/Stardrop.icns" | |
| chmod +x "Contents/MacOS/Stardrop" | |
| (cd ../ && codesign --force --deep -s - Stardrop.app) | |
| (cd ../ && zip -r ${GITHUB_WORKSPACE}/Stardrop-osx-x64.zip "Stardrop.app") | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-artifacts-macos | |
| path: | | |
| Stardrop-osx-x64.zip | |
| package-linux: | |
| if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'generate packages') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ env.BRANCH }} | |
| repository: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }} | |
| - run: mkdir -p path/to/release-artifacts | |
| - name: Publish (Linux - Creating) | |
| run: | | |
| dotnet publish "${{ env.WORKING_DIRECTORY }}" --output "${{ env.OUTPUT_PATH_LINUX }}/Stardrop" --configuration "${{ env.CONFIGURATION }}" --runtime "linux-x64" --framework "net8.0" --self-contained | |
| - name: Publish (Linux - Packaging) | |
| working-directory: "${{ env.OUTPUT_PATH_LINUX }}/Stardrop" | |
| run: | | |
| mv Stardrop Internal | |
| mv Stardrop.pdb Internal.pdb | |
| cp ${GITHUB_WORKSPACE}/Stardrop/Assets/Stardrop.sh Stardrop.sh | |
| chmod 755 ../Stardrop | |
| chmod +x Stardrop.sh | |
| chmod 644 Internal | |
| chmod 644 Internal.pdb | |
| (cd ../ && zip -r ${GITHUB_WORKSPACE}/Stardrop-linux-x64.zip "Stardrop") | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-artifacts-linux | |
| path: | | |
| Stardrop-linux-x64.zip | |
| package-windows: | |
| if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'generate packages') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ env.BRANCH }} | |
| repository: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }} | |
| - run: mkdir -p path/to/release-artifacts | |
| - name: Publish (Windows - Creating & Packaging) | |
| run: | | |
| dotnet publish "${{ env.WORKING_DIRECTORY }}" --output "${{ env.OUTPUT_PATH_WINDOWS }}/Stardrop" --configuration "${{ env.CONFIGURATION }}" --runtime "win-x64" --framework "net8.0" --self-contained | |
| (cd "${{ env.OUTPUT_PATH_WINDOWS }}" && zip -r ${GITHUB_WORKSPACE}/Stardrop-win-x64.zip "Stardrop") | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-artifacts-windows | |
| path: | | |
| Stardrop-win-x64.zip |