Skip to content

Commit

Permalink
refactor: setting file names
Browse files Browse the repository at this point in the history
  • Loading branch information
kraanzu committed Jan 27, 2024
1 parent e588181 commit f6d0aef
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,27 @@ jobs:
python -c "with open('smassh.py', 'w') as f: f.write('from smassh.__init__ import main\nmain()\n')"
pyinstaller -F smassh.py --add-data="smassh/ui/css/:smassh/ui/css"
- name: Set Binary file name
run: echo "BINARY_FILE_NAME=smassh${{ matrix.os == 'windows-latest' && '.exe' || '' }}" >> $GITHUB_ENV

- name: Set final file name
run: echo "FINAL_FILE_NAME=$(echo ${{ matrix.os }} | sed 's/-latest//;s/ubuntu/linux/')-smassh${{ matrix.os == 'windows-latest' && '.exe' || '' }}" >> $GITHUB_ENV

- name: Rename final file
run: cp ./dist/${{ env.BINARY_FILE_NAME }} ./dist/${{ env.FINAL_FILE_NAME }}
# Setup File name
- name: Set Binary file name on Linux and Mac
if: matrix.os != 'windows-latest'
run: echo "BINARY_FILE_NAME=smassh" >> $GITHUB_ENV

- name: Set Binary file name on Windows
if: matrix.os != 'windows-latest'
run: Add-Content -Path $env:GITHUB_ENV -Value "BINARY_FILE_NAME=smassh.exe"

# Setup final release file names
- name: Set Final file name on Linux
if: matrix.os == 'ubuntu-latest'
run: echo "FINAL_FILE_NAME=linux-smassh" >> $GITHUB_ENV

- name: Set Final file name on MacOs
if: matrix.os == 'macos-latest'
run: echo "FINAL_FILE_NAME=macos-smassh" >> $GITHUB_ENV

- name: Set Final file name on Windows
if: matrix.os == 'windows-latest'
run: Add-Content -Path $env:GITHUB_ENV -Value "FINAL_FILE_NAME=windows-smassh.exe"

- name: Release
uses: softprops/action-gh-release@v1
Expand Down

0 comments on commit f6d0aef

Please sign in to comment.