Made the release script manually dispatch-able

This commit is contained in:
Kingkor Roy Tirtho 2022-07-11 11:41:35 +06:00
parent bc9e451d6b
commit ec13b50146

View File

@ -1,9 +1,10 @@
name: Spotube Release name: Spotube Release
on: on:
release:
types:
- published
workflow_dispatch: workflow_dispatch:
inputs:
tag:
description: The tag to release
required: true
jobs: jobs:
publish_chocolatey: publish_chocolatey:
@ -15,18 +16,18 @@ jobs:
repository: KRTirtho/flutter_distributor repository: KRTirtho/flutter_distributor
ref: deb-implementation ref: deb-implementation
path: build/flutter_distributor path: build/flutter_distributor
- name: Get latest tag # - name: Get latest tag
id: tag # id: tag
uses: dawidd6/action-get-tag@v1 # uses: dawidd6/action-get-tag@v1
with: # with:
# Optionally strip `v` prefix # # Optionally strip `v` prefix
strip_v: true # strip_v: true
# Replace Version in files # Replace Version in files
- run: | - run: |
choco install sed make -y choco install sed make -y
sed -i "s/%{{SPOTUBE_VERSION}}%/${{ steps.tag.outputs.tag }}/" windows/runner/Runner.rc sed -i "s/%{{SPOTUBE_VERSION}}%/${{ github.event.inputs.tag }}/" windows/runner/Runner.rc
sed -i "s/%{{SPOTUBE_VERSION}}%/${{ steps.tag.outputs.tag }}/" choco-struct/tools/VERIFICATION.txt sed -i "s/%{{SPOTUBE_VERSION}}%/${{ github.event.inputs.tag }}/" choco-struct/tools/VERIFICATION.txt
sed -i "s/%{{SPOTUBE_VERSION}}%/${{ steps.tag.outputs.tag }}/" choco-struct/spotube.nuspec sed -i "s/%{{SPOTUBE_VERSION}}%/${{ github.event.inputs.tag }}/" choco-struct/spotube.nuspec
# Build Windows Executable # Build Windows Executable
- uses: subosito/flutter-action@v2.2.0 - uses: subosito/flutter-action@v2.2.0
@ -66,11 +67,11 @@ jobs:
runs-on: macos-11 runs-on: macos-11
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Get latest tag # - name: Get latest tag
uses: dawidd6/action-get-tag@v1 # uses: dawidd6/action-get-tag@v1
id: tag # id: tag
with: # with:
strip_v: true # strip_v: true
- uses: subosito/flutter-action@v2 - uses: subosito/flutter-action@v2
with: with:
cache: true cache: true
@ -81,23 +82,23 @@ jobs:
- run: du -sh build/macos/Build/Products/Release/spotube.app - run: du -sh build/macos/Build/Products/Release/spotube.app
- run: npm install -g appdmg - run: npm install -g appdmg
# using a versioned path for compatibility in gensums # using a versioned path for compatibility in gensums
- run: mkdir -p build/${{ steps.tag.outputs.tag }} - run: mkdir -p build/${{ github.event.inputs.tag }}
- run: appdmg appdmg.json build/${{ steps.tag.outputs.tag }}/Spotube-macos-x86_64.dmg - run: appdmg appdmg.json build/${{ github.event.inputs.tag }}/Spotube-macos-x86_64.dmg
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: Spotube-Macos-Bundle name: Spotube-Macos-Bundle
path: | path: |
build/${{ steps.tag.outputs.tag }}/Spotube-macos-x86_64.dmg build/${{ github.event.inputs.tag }}/Spotube-macos-x86_64.dmg
publish_linux: publish_linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Get latest tag # - name: Get latest tag
id: tag # id: tag
uses: dawidd6/action-get-tag@v1 # uses: dawidd6/action-get-tag@v1
with: # with:
strip_v: true # strip_v: true
- uses: subosito/flutter-action@v2 - uses: subosito/flutter-action@v2
with: with:
cache: true cache: true
@ -113,7 +114,7 @@ jobs:
mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder
# replacing & adding new release version with older version # replacing & adding new release version with older version
- run: | - run: |
sed -i 's|%{{APPDATA_RELEASE}}%|<release version="${{ steps.tag.outputs.tag }}" date="${{ steps.date.outputs.date }}" />|' linux/com.github.KRTirtho.Spotube.appdata.xml sed -i 's|%{{APPDATA_RELEASE}}%|<release version="${{ github.event.inputs.tag }}" date="${{ steps.date.outputs.date }}" />|' linux/com.github.KRTirtho.Spotube.appdata.xml
- run: | - run: |
flutter config --enable-linux-desktop flutter config --enable-linux-desktop
@ -135,11 +136,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Get latest tag # - name: Get latest tag
id: tag # id: tag
uses: dawidd6/action-get-tag@v1 # uses: dawidd6/action-get-tag@v1
with: # with:
strip_v: true # strip_v: true
- uses: subosito/flutter-action@v2 - uses: subosito/flutter-action@v2
with: with:
cache: true cache: true
@ -186,11 +187,11 @@ jobs:
with: with:
name: Spotube-Android-Bundle name: Spotube-Android-Bundle
path: ./Spotube-Android-Bundle path: ./Spotube-Android-Bundle
- name: Get latest tag # - name: Get latest tag
id: tag # id: tag
uses: dawidd6/action-get-tag@v1 # uses: dawidd6/action-get-tag@v1
with: # with:
strip_v: true # strip_v: true
- run: sudo apt-get install tree -y - run: sudo apt-get install tree -y
# generating checksums for all the binary # generating checksums for all the binary
- run: | - run: |
@ -208,7 +209,7 @@ jobs:
- uses: ncipollo/release-action@v1 - uses: ncipollo/release-action@v1
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ steps.tag.outputs.tag }} tag: v${{ github.event.inputs.tag }}
omitBodyDuringUpdate: true omitBodyDuringUpdate: true
omitNameDuringUpdate: true omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true omitPrereleaseDuringUpdate: true
@ -227,7 +228,7 @@ jobs:
# - run: | # - run: |
# winget install wingetcreate --silent # winget install wingetcreate --silent
# choco install tree -y # choco install tree -y
# wingetcreate update KRTirtho.Spotube --urls https://github.com/KRTirtho/spotube/releases/download/v${{ steps.tag.outputs.tag }}/Spotube-windows-x86_64-setup.exe https://github.com/KRTirtho/spotube/releases/download/v${{ steps.tag.outputs.tag }}/Spotube-windows-x86_64-setup.exe --version ${{ steps.tag.outputs.tag }} --token ${{ secrets.GITHUB_TOKEN }} --submit # wingetcreate update KRTirtho.Spotube --urls https://github.com/KRTirtho/spotube/releases/download/v${{ github.event.inputs.tag }}/Spotube-windows-x86_64-setup.exe https://github.com/KRTirtho/spotube/releases/download/v${{ github.event.inputs.tag }}/Spotube-windows-x86_64-setup.exe --version ${{ github.event.inputs.tag }} --token ${{ secrets.GITHUB_TOKEN }} --submit
publish_flathub: publish_flathub:
needs: update_release needs: update_release
@ -240,17 +241,17 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
path: spotube path: spotube
- name: Get latest tag # - name: Get latest tag
id: tag # id: tag
uses: dawidd6/action-get-tag@v1 # uses: dawidd6/action-get-tag@v1
with: # with:
strip_v: true # strip_v: true
- run: | - run: |
python3 spotube/scripts/update_flathub_version.py ${{ steps.tag.outputs.tag }} python3 spotube/scripts/update_flathub_version.py ${{ github.event.inputs.tag }}
rm -rf spotube rm -rf spotube
- uses: EndBug/add-and-commit@v9 - uses: EndBug/add-and-commit@v9
with: with:
message: v${{ steps.tag.outputs.tag }} Update message: v${{ github.event.inputs.tag }} Update
push: origin master push: origin master
publish_aur: publish_aur:
@ -258,17 +259,17 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Get latest tag # - name: Get latest tag
id: tag # id: tag
uses: dawidd6/action-get-tag@v1 # uses: dawidd6/action-get-tag@v1
with: # with:
strip_v: true # strip_v: true
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
name: Spotube-Linux-Bundle name: Spotube-Linux-Bundle
path: ./Spotube-Linux-Bundle path: ./Spotube-Linux-Bundle
- run: | - run: |
sed -i "s/%{{SPOTUBE_VERSION}}%/${{ steps.tag.outputs.tag }}/" aur-struct/PKGBUILD sed -i "s/%{{SPOTUBE_VERSION}}%/${{ github.event.inputs.tag }}/" aur-struct/PKGBUILD
sed -i "s/%{{PKGREL}}%/1/" aur-struct/PKGBUILD sed -i "s/%{{PKGREL}}%/1/" aur-struct/PKGBUILD
sed -i "s/%{{LINUX_MD5}}%/`md5sum Spotube-Linux-Bundle/Spotube-linux-x86_64.tar.xz | awk '{print $1}'`/" aur-struct/PKGBUILD sed -i "s/%{{LINUX_MD5}}%/`md5sum Spotube-Linux-Bundle/Spotube-linux-x86_64.tar.xz | awk '{print $1}'`/" aur-struct/PKGBUILD
- uses: KSXGitHub/github-actions-deploy-aur@v2.2.5 - uses: KSXGitHub/github-actions-deploy-aur@v2.2.5
@ -278,4 +279,4 @@ jobs:
commit_username: ${{ secrets.AUR_USERNAME }} commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }} commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Updated to v${{ steps.tag.outputs.tag }} commit_message: Updated to v${{ github.event.inputs.tag }}