Skip to content

20241107: Build and release process improvements #33

20241107: Build and release process improvements

20241107: Build and release process improvements #33

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Build Linux Binaries
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
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
- name: build
run: npm run build:linux:x64;npm run build:linux:arm64
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 '"').tar.gz .;cd ../../;done;ls -la
working-directory: ./server/dist
- 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}}.tar.gz,server/dist/spotify97-server-linux-x64-${{env.PACKAGE_VERSION}}.tar.gz"
target: /srv/www/public/spotifyclient97/server/${{ env.PACKAGE_VERSION }}/${{ env.SHA }}/
strip_components: 2