Skip to content

Commit

Permalink
fix: release step
Browse files Browse the repository at this point in the history
  • Loading branch information
ai-mindset committed Nov 10, 2024
1 parent eb1382d commit 5345955
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 30 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/unix-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,29 +65,37 @@ jobs:
--name "pdf-converter-$PLATFORM-$ARCH" \
src/pdf_converter/app.py
- name: Create ZIP archive
run: |
cd dist
zip "pdf-converter-${{ matrix.platform }}-${{ matrix.arch }}.zip" "pdf-converter-${{ matrix.platform }}-${{ matrix.arch }}"
# - name: Create ZIP archive
# run: |
# cd dist
# zip "pdf-converter-${{ matrix.platform }}-${{ matrix.arch }}.zip" "pdf-converter-${{ matrix.platform }}-${{ matrix.arch }}"

# - name: Upload artifact
# uses: actions/upload-artifact@v4
# with:
# name: pdf-converter-${{ matrix.platform }}-${{ matrix.arch }}
# path: dist/pdf-converter-${{ matrix.platform }}-${{ matrix.arch }}.zip
#

- name: Create TAR.GZ archive
run: |
cd dist
if [ -f "pdf-converter-${{ matrix.platform }}-${{ matrix.arch }}" ]; then
tar -czf "pdf-converter-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz" "pdf-converter-${{ matrix.platform }}-${{ matrix.arch }}"
echo "dist_empty=false" >> $GITHUB_ENV
else
echo "No executable found in dist/"
echo "dist_empty=true" >> $GITHUB_ENV
fi
- name: Generate version
id: version
run: echo "version=$(date +'%Y.%m.%d-%H%M')" >> $GITHUB_OUTPUT

- name: Create Release
uses: softprops/action-gh-release@v1
- name: Upload Release
if: env.dist_empty == 'false'
uses: svenstaro/upload-release-action@v2
with:
name: Release ${{ steps.version.outputs.version }}
tag_name: v${{ steps.version.outputs.version }}
draft: false
prerelease: false
generate_release_notes: true
files: dist/pdf-converter-${{ matrix.platform }}-${{ matrix.arch }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/pdf-converter-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz
tag: v${{ steps.version.outputs.version }}
overwrite: true
40 changes: 25 additions & 15 deletions .github/workflows/win-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,38 @@ jobs:
--windowed `
src/pdf_converter/app.py
- name: Create ZIP archive
run: |
Compress-Archive -Path "dist/pdf-converter.exe" -DestinationPath "dist/pdf-converter-windows.zip"
# - name: Create ZIP archive
# run: |
# Compress-Archive -Path "dist/pdf-converter.exe" -DestinationPath "dist/pdf-converter-windows.zip"

# - name: Upload artifact
# uses: actions/upload-artifact@v4
# with:
# name: pdf-converter-windows
# path: dist/pdf-converter-windows.zip


- name: Create ZIP archive
shell: pwsh
run: |
cd dist
if (Test-Path "pdf-converter.exe") {
Compress-Archive -Path "pdf-converter.exe" -DestinationPath "pdf-converter-windows.zip"
echo "dist_empty=false" | Out-File -FilePath $env:GITHUB_ENV -Append
} else {
echo "No executable found in dist/"
echo "dist_empty=true" | Out-File -FilePath $env:GITHUB_ENV -Append
}
- name: Generate version
id: version
run: echo "version=$(date +'%Y.%m.%d-%H%M')" >> $env:GITHUB_OUTPUT
shell: bash
run: echo "version=$(date +'%Y.%m.%d-%H%M')" >> $GITHUB_OUTPUT

- name: Create Release
uses: softprops/action-gh-release@v1
- name: Upload Release
if: env.dist_empty == 'false'
uses: svenstaro/upload-release-action@v2
with:
name: Release ${{ steps.version.outputs.version }}
tag_name: v${{ steps.version.outputs.version }}
draft: false
prerelease: false
generate_release_notes: true
files: dist/pdf-converter-windows.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/pdf-converter-windows.zip
tag: v${{ steps.version.outputs.version }}
overwrite: true

0 comments on commit 5345955

Please sign in to comment.