diff --git a/.github/workflows/bundle-linux.yml b/.github/workflows/bundle-linux.yml new file mode 100644 index 00000000..1a187276 --- /dev/null +++ b/.github/workflows/bundle-linux.yml @@ -0,0 +1,43 @@ +# build-linux.yml +# Reusable workflow that builds the Libation installation bundles for Linux and MacOS. +--- +name: bundle-linux + +on: + workflow_call: + inputs: + version: + type: string + description: 'Version number' + required: true + +jobs: + bundle: + runs-on: ubuntu-latest + strategy: + matrix: + os: [linux, macos] + release_name: [chardonnay] + steps: + - uses: actions/checkout@v3 + + - name: Download Artifact + uses: actions/download-artifact@v3 + with: + name: "Libation.${{ inputs.version }}-${{ matrix.os }}-${{ matrix.release_name }}.tar.gz" + + - name: Build bundle + id: build + run: | + SCRIPT=targz2${{ matrix.os }}bundle.sh + chmod +rwx ./Scripts/${SCRIPT} + ./Scripts/${SCRIPT} "Libation.${{ inputs.version }}-${{ matrix.os }}-${{ matrix.release_name }}.tar.gz" ${{ inputs.version }} + artifact=$(ls ./bundle) + echo "artifact=${artifact}" >> "${GITHUB_OUTPUT}" + + - name: Publish bundle + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.build.outputs.artifact }} + path: ./bundle/${{ steps.build.outputs.artifact }} + if-no-files-found: error diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml deleted file mode 100644 index cd6e0acb..00000000 --- a/.github/workflows/bundle.yml +++ /dev/null @@ -1,39 +0,0 @@ -# bundle.yml -# Reusable workflow that builds the MacOS app bundle. ---- -name: bundle - -on: - workflow_call: - inputs: - version: - type: string - description: 'Version number' - required: true - -env: - FILE_NAME: "Libation.${{ inputs.version }}-macos-chardonnay" - -jobs: - build_bundle: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Download Artifact - uses: actions/download-artifact@v3 - with: - name: "${{ env.FILE_NAME }}.tar.gz" - - - name: Build .app bundle - id: bundle - run: | - chmod +rwx ./Scripts/targz2bundle.sh - ./Scripts/targz2bundle.sh "${{ env.FILE_NAME }}.tar.gz" ${{ inputs.version }} - - - name: Publish .app bundle - uses: actions/upload-artifact@v3 - with: - name: "Libation.app-${{ inputs.version }}.tar.gz" - path: "Libation.app-${{ inputs.version }}.tar.gz" - if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e164a97..3d9e5fca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,20 +34,14 @@ jobs: version_override: ${{ needs.prerelease.outputs.version }} run_unit_tests: false - deb: - needs: [prerelease,build] - uses: ./.github/workflows/deb.yml - with: - version: ${{ needs.prerelease.outputs.version }} - bundle: needs: [prerelease,build] - uses: ./.github/workflows/bundle.yml + uses: ./.github/workflows/bundle-linux.yml with: version: ${{ needs.prerelease.outputs.version }} release: - needs: [prerelease,build,deb,bundle] + needs: [prerelease,build,bundle] runs-on: ubuntu-latest steps: - name: Download artifacts @@ -59,7 +53,7 @@ jobs: id: release uses: softprops/action-gh-release@v1 with: - name: Libation ${{ needs.prerelease.outputs.version }} + name: Libation v${{ needs.prerelease.outputs.version }} body: draft: true prerelease: false diff --git a/Scripts/targz2deb.sh b/Scripts/targz2linuxbundle.sh old mode 100755 new mode 100644 similarity index 96% rename from Scripts/targz2deb.sh rename to Scripts/targz2linuxbundle.sh index 0c0f337d..145e2a3a --- a/Scripts/targz2deb.sh +++ b/Scripts/targz2linuxbundle.sh @@ -130,7 +130,10 @@ chmod +x "$FOLDER_DEBIAN/postinst" echo "Creating .deb file..." dpkg-deb -Zxz --build $FOLDER_MAIN +mkdir bundle +echo "moving to ./bundle/$FOLDER_MAIN.deb" +mv "$FOLDER_MAIN.deb" "./bundle/$FOLDER_MAIN.deb" + rm -r "$FOLDER_MAIN" echo "Done!" - diff --git a/Scripts/targz2bundle.sh b/Scripts/targz2macosbundle.sh similarity index 93% rename from Scripts/targz2bundle.sh rename to Scripts/targz2macosbundle.sh index 4d59cc9a..1defb754 100644 --- a/Scripts/targz2bundle.sh +++ b/Scripts/targz2macosbundle.sh @@ -29,7 +29,6 @@ then exit fi -# remove trailing ".tar.gz" BUNDLE="Libation.app" echo "Bundle dir: $BUNDLE" @@ -76,6 +75,10 @@ for n in "${delfiles[@]}"; do rm "$BUNDLE_MACOS/$n"; done echo "Creating app bundle: $BUNDLE-$VERSION.tar.gz" tar -czvf "$BUNDLE-$VERSION.tar.gz" "$BUNDLE" +mkdir bundle +echo "moving to ./bundle/$BUNDLE-$VERSION.tar.gz" +mv "$BUNDLE-$VERSION.tar.gz" "./bundle/$BUNDLE-$VERSION.tar.gz" + rm -r "$BUNDLE" echo "Done!"