Try next day #9
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: deploy-macos | |
| on: | |
| push: | |
| branches: | |
| - fix_dmg | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ macos-13 ] | |
| conda_platform: [ osx-64 ] | |
| artifact_name: [ gemsgui-macos ] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get version from CMakeLists.txt | |
| id: get_version | |
| uses: DarwinInnovation/cmake-project-version-action@v1.0 | |
| - name: Set deploy name | |
| id: strings | |
| shell: bash | |
| run: > | |
| echo "deploy-name=GEMS${{ steps.get_version.outputs.version }}" >> "$GITHUB_OUTPUT" | |
| - name: Set deploy dir | |
| id: strings2 | |
| shell: bash | |
| run: | | |
| echo "deploy-output-dir=${{ github.workspace }}/${{ steps.strings.outputs.deploy-name }}" >> "$GITHUB_OUTPUT" | |
| echo "deploy-output-name=macos-${{ steps.strings.outputs.deploy-name }}.zip" >> "$GITHUB_OUTPUT" | |
| - name: Setup Conda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| auto-activate-base: false | |
| channels: conda-forge, defaults | |
| channel-priority: true | |
| - name: Configuring Conda Environment | |
| run: | | |
| conda config --set always_yes yes --set changeps1 no | |
| conda config --add channels conda-forge | |
| conda install conda-devenv | |
| conda devenv | |
| - name: Building, Testing & Installing GEMSGUI | |
| if: matrix.os != 'windows-latest' | |
| shell: bash -l {0} | |
| run: | | |
| conda activate GEMSGUI | |
| mkdir .build && cd .build | |
| cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ steps.strings2.outputs.deploy-output-dir }} | |
| ninja | |
| ninja install | |
| - name: Check deploy | |
| run: | | |
| cd ${{ github.workspace }} | |
| ls | |
| cp -r "${{ github.workspace }}/Resources" "${{ github.workspace }}/${{ steps.strings.outputs.deploy-name }}/gem-selektor.app/Contents" | |
| cp "${{ github.workspace }}/Resources/rungems3-mac.sh" "${{ github.workspace }}/${{ steps.strings.outputs.deploy-name }}/rungems3.sh" | |
| cp "${{ github.workspace }}/Resources/README-macos.txt" "${{ github.workspace }}/${{ steps.strings.outputs.deploy-name }}/README.txt" | |
| # hdiutil detach "${{ github.workspace }}/${{ steps.strings.outputs.deploy-name }}/gem-selektor.app" -force | |
| # Create ZIP archive for GitHub release (unchanged) | |
| - name: Create dmg | |
| uses: L-Super/create-dmg-actions@v1 | |
| with: | |
| dmg_name: 'macos-${{ steps.strings.outputs.deploy-name }}' | |
| src_dir: '${{ github.workspace }}/${{ steps.strings.outputs.deploy-name }}/gem-selektor.app' | |
| # Upload DMG artifact | |
| - name: Upload artifact DMG | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-${{ steps.strings.outputs.deploy-name }}.dmg | |
| path: ${{ github.workspace }}/macos-${{ steps.strings.outputs.deploy-name }}.dmg | |
| # Create ZIP archive for GitHub release (unchanged) | |
| - name: Create zip archive for GitHub release | |
| run: | | |
| cd ${{ github.workspace }} | |
| zip -r ${{ steps.strings2.outputs.deploy-output-name }} ${{ steps.strings.outputs.deploy-name }} | |
| # Upload ZIP artifact | |
| - name: Upload artifact ZIP | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-${{ steps.strings.outputs.deploy-name }}-zip | |
| path: ${{ github.workspace }}/${{ steps.strings2.outputs.deploy-output-name }} | |
| # Upload ZIP release asset | |
| - name: Upload ZIP release asset | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ${{ github.workspace }}/${{ steps.strings2.outputs.deploy-output-name }} | |
| asset_name: ${{ steps.strings2.outputs.deploy-output-name }} | |
| asset_content_type: application/zip | |
| # Upload DMG release asset | |
| - name: Upload DMG release asset | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ${{ github.workspace }}/macos-${{ steps.strings.outputs.deploy-name }}.dmg | |
| asset_name: macos-${{ steps.strings.outputs.deploy-name }}.dmg | |
| asset_content_type: application/x-apple-diskimage |