cd: use versioned file name for spotube tar.xz binary

This commit is contained in:
Kingkor Roy Tirtho 2023-03-16 10:40:14 +06:00
parent 0ac555c4e2
commit 2c24ed6495
2 changed files with 21 additions and 14 deletions

View File

@ -29,7 +29,7 @@ jobs:
with: with:
cache: true cache: true
- name: Replace pubspec version (nightly) - name: Replace pubspec version and BUILD_VERSION Env (nightly)
if: ${{ inputs.channel == 'nightly' }} if: ${{ inputs.channel == 'nightly' }}
run: | run: |
choco install sed make yq -y choco install sed make yq -y
@ -37,7 +37,7 @@ jobs:
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
"BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $env:GITHUB_ENV "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $env:GITHUB_ENV
- name: Replace pubspec version (stable) - name: BUILD_VERSION Env (stable)
if: ${{ inputs.channel == 'stable' }} if: ${{ inputs.channel == 'stable' }}
run: | run: |
"BUILD_VERSION=${{ inputs.version }}" >> $env:GITHUB_ENV "BUILD_VERSION=${{ inputs.version }}" >> $env:GITHUB_ENV
@ -107,7 +107,7 @@ jobs:
chmod +x appimagetool chmod +x appimagetool
mv appimagetool /usr/local/bin/ mv appimagetool /usr/local/bin/
- name: Replace pubspec version (nightly) - name: Replace pubspec version and BUILD_VERSION Env (nightly)
if: ${{ inputs.channel == 'nightly' }} if: ${{ inputs.channel == 'nightly' }}
run: | run: |
curl -sS https://webi.sh/yq | sh curl -sS https://webi.sh/yq | sh
@ -115,7 +115,7 @@ jobs:
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
echo "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $GITHUB_ENV echo "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $GITHUB_ENV
- name: Replace pubspec version (stable) - name: BUILD_VERSION Env (stable)
if: ${{ inputs.channel == 'stable' }} if: ${{ inputs.channel == 'stable' }}
run: | run: |
echo "BUILD_VERSION=${{ inputs.version }}" >> $GITHUB_ENV echo "BUILD_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
@ -142,11 +142,18 @@ jobs:
run: | run: |
dart pub global activate flutter_distributor dart pub global activate flutter_distributor
flutter_distributor package --platform=linux --targets=deb,appimage,rpm --skip-clean flutter_distributor package --platform=linux --targets=deb,appimage,rpm --skip-clean
make tar
- name: Create tar.xz (stable)
if: ${{ inputs.channel == 'stable' }}
run: make tar VERSION=${{ env.BUILD_VERSION }}
- name: Create tar.xz (nightly)
if: ${{ inputs.channel == 'nightly' }}
run: make tar VERSION=nightly
- name: Move Files to dist - name: Move Files to dist
run: | run: |
mv build/Spotube-linux-x86_64.tar.xz dist/ mv build/spotube-linux-*-x86_64.tar.xz dist/
mv dist/**/spotube-*-linux.deb dist/Spotube-linux-x86_64.deb mv dist/**/spotube-*-linux.deb dist/Spotube-linux-x86_64.deb
mv dist/**/spotube-*-linux.rpm dist/Spotube-linux-x86_64.rpm mv dist/**/spotube-*-linux.rpm dist/Spotube-linux-x86_64.rpm
mv dist/**/spotube-*-linux.AppImage dist/Spotube-linux-x86_64.AppImage mv dist/**/spotube-*-linux.AppImage dist/Spotube-linux-x86_64.AppImage
@ -169,7 +176,7 @@ jobs:
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev make python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev make python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
- name: Replace pubspec version (nightly) - name: Replace pubspec version and BUILD_VERSION Env (nightly)
if: ${{ inputs.channel == 'nightly' }} if: ${{ inputs.channel == 'nightly' }}
run: | run: |
curl -sS https://webi.sh/yq | sh curl -sS https://webi.sh/yq | sh
@ -177,7 +184,7 @@ jobs:
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
echo "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $GITHUB_ENV echo "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $GITHUB_ENV
- name: Replace pubspec version (stable) - name: BUILD_VERSION Env (stable)
if: ${{ inputs.channel == 'stable' }} if: ${{ inputs.channel == 'stable' }}
run: | run: |
echo "BUILD_VERSION=${{ inputs.version }}" >> $GITHUB_ENV echo "BUILD_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
@ -219,7 +226,7 @@ jobs:
with: with:
cache: true cache: true
- name: Replace pubspec version (nightly) - name: Replace pubspec version and BUILD_VERSION Env (nightly)
if: ${{ inputs.channel == 'nightly' }} if: ${{ inputs.channel == 'nightly' }}
run: | run: |
brew install yq brew install yq
@ -227,7 +234,7 @@ jobs:
yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml
echo "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $GITHUB_ENV echo "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $GITHUB_ENV
- name: Replace pubspec version (stable) - name: BUILD_VERSION Env (stable)
if: ${{ inputs.channel == 'stable' }} if: ${{ inputs.channel == 'stable' }}
run: | run: |
echo "BUILD_VERSION=${{ inputs.version }}" >> $GITHUB_ENV echo "BUILD_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
@ -282,9 +289,9 @@ jobs:
- name: Generate Checksums - name: Generate Checksums
run: | run: |
tree . tree .
md5sum ./Spotube-Release-Binaries/* >> RELEASE.md5sum md5sum Spotube-Release-Binaries/* >> RELEASE.md5sum
sha256sum ./Spotube-Release-Binaries/* >> RELEASE.sha256sum sha256sum Spotube-Release-Binaries/* >> RELEASE.sha256sum
sed -i 's|./Spotube-Release-Binaries/||' RELEASE.sha256sum RELEASE.md5sum sed -i 's|Spotube-Release-Binaries/||' RELEASE.sha256sum RELEASE.md5sum
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:

View File

@ -19,7 +19,7 @@ tar:
&& cp linux/spotube.desktop $(TEMP_DIR)\ && cp linux/spotube.desktop $(TEMP_DIR)\
&& cp assets/spotube-logo.png $(TEMP_DIR)\ && cp assets/spotube-logo.png $(TEMP_DIR)\
&& cp linux/com.github.KRTirtho.Spotube.appdata.xml $(TEMP_DIR)\ && cp linux/com.github.KRTirtho.Spotube.appdata.xml $(TEMP_DIR)\
&& tar -cJf build/Spotube-linux-x86_64.tar.xz -C $(TEMP_DIR) .\ && tar -cJf build/spotube-linux-${VERSION}-x86_64.tar.xz -C $(TEMP_DIR) .\
&& rm -rf $(TEMP_DIR) && rm -rf $(TEMP_DIR)
appimage: appimage: