Skip to content

Commit

Permalink
feat(ci): create tarballs
Browse files Browse the repository at this point in the history
  • Loading branch information
f0e committed Dec 3, 2024
1 parent 669b34b commit b2fc91b
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,18 @@ jobs:
else
echo "cli_source=blur-cli" >> $GITHUB_OUTPUT
echo "cli_binary=blur-cli-$configuration" >> $GITHUB_OUTPUT
echo "gui_source=blur" >> $GITHUB_OUTPUT
echo "gui_binary=blur-$configuration" >> $GITHUB_OUTPUT
fi
- name: Rename and Make Binaries Executable
if: runner.os != 'Windows'
run: |
cd ${{ steps.binary-names.outputs.build_dir }}
chmod +x "${{ steps.binary-names.outputs.cli_source }}"
chmod +x "${{ steps.binary-names.outputs.gui_source }}"
- name: Install create-dmg (macOS)
if: runner.os == 'macOS'
run: |
Expand All @@ -124,7 +131,6 @@ jobs:
--volname "Blur Installer" \
--icon "Blur.app" 200 190 \
--hide-extension "Blur.app" \
--app-drop-link 600 185 \
"${{ steps.binary-names.outputs.gui_binary }}" \
"source_folder"
Expand All @@ -134,29 +140,40 @@ jobs:
cd ${{ steps.binary-names.outputs.build_dir }}
mv "${{ steps.binary-names.outputs.cli_source }}" "${{ steps.binary-names.outputs.cli_binary }}"
if [[ "$RUNNER_OS" != "macOS" ]]; then
mv "${{ steps.binary-names.outputs.gui_source }}" "${{ steps.binary-names.outputs.gui_binary }}"
fi
if [[ "$RUNNER_OS" != "Windows" ]]; then
tar -czf "${{ steps.binary-names.outputs.configuration }}-cli.tar.gz" "${{ steps.binary-names.outputs.cli_binary }}"
echo "cli_binary=${{ steps.binary-names.outputs.configuration }}-cli.tar.gz" >> $GITHUB_OUTPUT
if [[ "$RUNNER_OS" == "Linux" || "$RUNNER_OS" == "macOS" ]]; then
chmod +x "${{ steps.binary-names.outputs.cli_binary }}"
chmod +x "${{ steps.binary-names.outputs.gui_binary }}"
if [[ "$RUNNER_OS" == "Linux" ]]; then
mv "${{ steps.binary-names.outputs.gui_source }}" "${{ steps.binary-names.outputs.gui_binary }}"
tar -czf "${{ steps.binary-names.outputs.configuration }}-gui.tar.gz" "${{ steps.binary-names.outputs.gui_binary }}"
echo "gui_binary=${{ steps.binary-names.outputs.configuration }}-gui.tar.gz" >> $GITHUB_OUTPUT
fi
fi
- name: Upload Binaries
- name: Generate Checksums
run: |
cd ${{ steps.binary-names.outputs.build_dir }}
sha256sum "${{ steps.binary-names.outputs.cli_binary }}" > "${{ steps.binary-names.outputs.cli_binary }}.sha256"
sha256sum "${{ steps.binary-names.outputs.gui_binary }}" > "${{ steps.binary-names.outputs.gui_binary }}.sha256"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Blur-${{ steps.binary-names.outputs.configuration }}
path: |
${{ steps.binary-names.outputs.build_dir }}/${{ steps.binary-names.outputs.cli_binary }}
${{ steps.binary-names.outputs.build_dir }}/${{ steps.binary-names.outputs.cli_binary }}.sha256
${{ steps.binary-names.outputs.build_dir }}/${{ steps.binary-names.outputs.gui_binary }}
${{ steps.binary-names.outputs.build_dir }}/${{ steps.binary-names.outputs.gui_binary }}.sha256
- name: Release
uses: softprops/action-gh-release@v1
if: ${{ env.is_tag == 'true' }}
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
with:
files: |
${{ steps.binary-names.outputs.build_dir }}/${{ steps.binary-names.outputs.cli_binary }}
${{ steps.binary-names.outputs.build_dir }}/${{ steps.binary-names.outputs.cli_binary }}.sha256
${{ steps.binary-names.outputs.build_dir }}/${{ steps.binary-names.outputs.gui_binary }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
${{ steps.binary-names.outputs.build_dir }}/${{ steps.binary-names.outputs.gui_binary }}.sha256

0 comments on commit b2fc91b

Please sign in to comment.