1.2.1.0: Server QoL improvements, deployment updates (#4) #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Build | |
# If tag matching current package.json version exists, that tag will be built | |
# else, it will be created using the commit provided as the input | |
# on pushing a new tag, it should build that tag and release it | |
# tag used to generate release is ALWAYS the package.json version so keep that in mind | |
on: | |
workflow_dispatch: | |
inputs: | |
commit: | |
description: "commit or branch to release" | |
required: false | |
type: string | |
push: | |
tags: | |
- "*" | |
jobs: | |
windows: | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: ./server | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: "npm" | |
node-version-file: "./server/.nvmrc" | |
cache-dependency-path: "server/package-lock.json" | |
- uses: jozsefsallai/[email protected] | |
with: | |
path: server/package.json | |
- uses: benjlevesque/[email protected] | |
- run: npm ci | |
working-directory: ./server | |
- run: npm run build:windows | |
working-directory: ./server | |
- name: archive | |
run: Compress-Archive -LiteralPath win -DestinationPath spotify97-server-win64-${{ env.PACKAGE_VERSION }}-release.zip | |
working-directory: ./server/dist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: spotify97-server-win64-${{ env.PACKAGE_VERSION }}-release | |
path: server/dist/spotify97-server-win64-${{ env.PACKAGE_VERSION }}-release.zip | |
macos: | |
runs-on: macos-latest | |
defaults: | |
run: | |
working-directory: ./server | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: "npm" | |
node-version-file: "./server/.nvmrc" | |
cache-dependency-path: "server/package-lock.json" | |
- uses: jozsefsallai/[email protected] | |
with: | |
path: server/package.json | |
- uses: benjlevesque/[email protected] | |
- run: npm ci | |
working-directory: ./server | |
- run: npm run build:macos | |
working-directory: ./server | |
- name: archive | |
run: for platform in "macos/x64";do cd $platform;tar -cvzf ../../spotify97-server-$(echo $platform | tr "/" "-")-$(npm pkg get version | tr -d '"')-release.tar.gz .;cd ../../;done;ls -la | |
working-directory: ./server/dist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: spotify97-server-macos-x64-${{ env.PACKAGE_VERSION }}-release | |
path: server/dist/spotify97-server-macos-x64-${{ env.PACKAGE_VERSION }}-release.tar.gz | |
linux: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./server | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: "npm" | |
node-version-file: "./server/.nvmrc" | |
cache-dependency-path: "server/package-lock.json" | |
- uses: jozsefsallai/[email protected] | |
with: | |
path: server/package.json | |
- uses: benjlevesque/[email protected] | |
- run: npm ci | |
working-directory: ./server | |
- run: npm run build:all | |
working-directory: ./server | |
- name: archive | |
run: for platform in "linux/arm64" "linux/x64";do cd $platform;tar -cvzf ../../spotify97-server-$(echo $platform | tr "/" "-")-$(npm pkg get version | tr -d '"')-release.tar.gz .;cd ../../;done;ls -la | |
working-directory: ./server/dist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: spotify97-server-linux-x64-${{ env.PACKAGE_VERSION }}-release | |
path: server/dist/spotify97-server-linux-x64-${{ env.PACKAGE_VERSION }}-release.tar.gz | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: spotify97-server-linux-arm64-${{ env.PACKAGE_VERSION }}-release | |
path: server/dist/spotify97-server-linux-arm64-${{ env.PACKAGE_VERSION }}-release.tar.gz | |
- name: upload | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
port: ${{ secrets.PORT }} | |
key: ${{ secrets.KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
source: "server/dist/spotify97-server-linux-arm64-${{env.PACKAGE_VERSION}}-release.tar.gz,server/dist/spotify97-server-linux-x64-${{env.PACKAGE_VERSION}}-release.tar.gz" | |
target: /srv/www/public/spotifyclient97/downloads/server/${{ env.PACKAGE_VERSION }}/release/ | |
strip_components: 2 | |
publish: | |
runs-on: ubuntu-latest | |
needs: ["windows", "linux", "macos"] | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: jozsefsallai/[email protected] | |
with: | |
path: server/package.json | |
- name: download linux-arm64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: spotify97-server-linux-arm64-${{ env.PACKAGE_VERSION }}-release | |
path: . | |
- name: download linux-x64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: spotify97-server-linux-x64-${{ env.PACKAGE_VERSION }}-release | |
path: . | |
- name: download macos-x64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: spotify97-server-macos-x64-${{ env.PACKAGE_VERSION }}-release | |
path: . | |
- name: download win64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: spotify97-server-win64-${{ env.PACKAGE_VERSION }}-release | |
path: . | |
- run: ls -la | |
- name: upload client | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
port: ${{ secrets.PORT }} | |
key: ${{ secrets.KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
source: "./client/Spotify97MacEdition/dist/*,./client/SpotifyClient97/dist/*" | |
target: /srv/www/public/spotifyclient97/downloads/ | |
- name: upload server | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
port: ${{ secrets.PORT }} | |
key: ${{ secrets.KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
source: "spotify97-server-win64-${{env.PACKAGE_VERSION}}-release.zip,spotify97-server-macos-x64-${{env.PACKAGE_VERSION}}.tar.gz" | |
target: /srv/www/public/spotifyclient97/downloads/server/${{ env.PACKAGE_VERSION }}/release | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "spotify97-server-*.tar.gz,spotify97-server-*.zip,client/Spotify97MacEdition/dist/*,client/SpotifyClient97/dist/*" | |
allowUpdates: true | |
generateReleaseNotes: true | |
tag: v${{ env.PACKAGE_VERSION }} | |
commit: ${{ inputs.commit }} | |
name: "v${{ env.PACKAGE_VERSION }}" |