-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
20241107: Build and release process improvements
- Loading branch information
1 parent
c4598af
commit 00a2936
Showing
5 changed files
with
65 additions
and
51 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,26 +20,22 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
node-version-file: './server/.nvmrc' | ||
cache-dependency-path: 'server/package-lock.json' | ||
- name: version | ||
uses: jozsefsallai/[email protected] | ||
- uses: jozsefsallai/[email protected] | ||
with: | ||
path: server/package.json | ||
- uses: benjlevesque/[email protected] | ||
- name: install | ||
run: npm ci | ||
- 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 tar -cvzf spotify97-server-$(echo $platform | tr "/" "-")-$(npm pkg get version | tr -d '"').tar.gz $platform;done;ls -la | ||
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] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,34 +12,28 @@ on: | |
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
runs-on: macos-latest | ||
defaults: | ||
run: | ||
working-directory: ./server | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
node-version-file: './server/.nvmrc' | ||
cache-dependency-path: 'server/package-lock.json' | ||
- name: version | ||
uses: jozsefsallai/[email protected] | ||
- uses: jozsefsallai/[email protected] | ||
with: | ||
path: server/package.json | ||
- uses: benjlevesque/[email protected] | ||
- name: install | ||
run: npm ci | ||
- run: npm ci | ||
working-directory: ./server | ||
- name: build | ||
run: npm run build:macos | ||
- run: npm run build:macos | ||
working-directory: ./server | ||
- name: archive | ||
run: for platform in "macos/x64";do tar -cvzf spotify97-server-$(echo $platform | tr "/" "-")-$(npm pkg get version | tr -d '"').tar.gz $platform;done;ls -la | ||
run: for platform in "macos/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] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,30 +13,24 @@ jobs: | |
build: | ||
|
||
runs-on: windows-latest | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
defaults: | ||
run: | ||
working-directory: ./server | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
node-version-file: './server/.nvmrc' | ||
cache-dependency-path: 'server/package-lock.json' | ||
- name: version | ||
uses: jozsefsallai/[email protected] | ||
- uses: jozsefsallai/[email protected] | ||
with: | ||
path: server/package.json | ||
- uses: benjlevesque/[email protected] | ||
- name: install | ||
run: npm ci | ||
- run: npm ci | ||
working-directory: ./server | ||
- name: build | ||
run: npm run build:windows | ||
- run: npm run build:windows | ||
working-directory: ./server | ||
- name: archive | ||
run: Compress-Archive -LiteralPath win -DestinationPath spotify97-server-win64-${{ env.PACKAGE_VERSION }}.zip;dir win;dir | ||
|
@@ -50,13 +44,11 @@ jobs: | |
needs: "build" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: version | ||
uses: jozsefsallai/[email protected] | ||
- uses: jozsefsallai/[email protected] | ||
with: | ||
path: server/package.json | ||
- uses: benjlevesque/[email protected] | ||
- name: download | ||
uses: actions/download-artifact@v4 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: windows-binary-${{ env.SHA }} | ||
path: . | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
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: | ||
# tag: | ||
# description: "tag to release" | ||
# required: true | ||
# type: string | ||
commit: | ||
description: "commit or branch to release" | ||
required: true | ||
default: "main" | ||
required: false | ||
type: string | ||
push: | ||
tags: | ||
|
@@ -20,7 +19,6 @@ jobs: | |
windows: | ||
runs-on: | ||
windows-latest | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
defaults: | ||
run: | ||
working-directory: ./server | ||
|
@@ -46,10 +44,48 @@ jobs: | |
with: | ||
name: spotify97-server-win64-${{ env.PACKAGE_VERSION }}-release | ||
path: server/dist/spotify97-server-win64-${{ env.PACKAGE_VERSION }}-release.zip | ||
nix: | ||
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 | ||
- 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,server/dist/spotify97-server-macos-x64-${{ env.PACKAGE_VERSION }}-release.tar.gz" | ||
target: /srv/www/public/spotifyclient97/server/${{ env.PACKAGE_VERSION }}/release/ | ||
strip_components: 2 | ||
linux: | ||
runs-on: | ||
ubuntu-latest | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
defaults: | ||
run: | ||
working-directory: ./server | ||
|
@@ -69,7 +105,7 @@ jobs: | |
- run: npm run build:all | ||
working-directory: ./server | ||
- name: archive | ||
run: for platform in "linux/arm64" "linux/x64" "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 | ||
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: | ||
|
@@ -79,10 +115,6 @@ jobs: | |
with: | ||
name: spotify97-server-linux-arm64-${{ env.PACKAGE_VERSION }}-release | ||
path: server/dist/spotify97-server-linux-arm64-${{ env.PACKAGE_VERSION }}-release.tar.gz | ||
- 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 | ||
- name: upload | ||
uses: appleboy/[email protected] | ||
with: | ||
|
@@ -91,12 +123,12 @@ jobs: | |
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,server/dist/spotify97-server-macos-x64-${{ env.PACKAGE_VERSION }}-release.tar.gz" | ||
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/server/${{ env.PACKAGE_VERSION }}/release/ | ||
strip_components: 2 | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: ["windows", "nix"] | ||
needs: ["windows", "linux", "macos"] | ||
permissions: | ||
contents: write | ||
steps: | ||
|