server: Fix Vehicle.passengers breaking build (#275) #1009
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: Publish packages | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
shared: | |
name: Publish shared | |
runs-on: ubuntu-latest | |
if: "contains(github.event.head_commit.message, 'Bump version')" | |
defaults: | |
run: | |
working-directory: ./shared | |
steps: | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18.x | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Check package version | |
id: pkgver | |
run: | | |
echo "::set-output name=local::$(node -p -e "require('./package.json').version")" | |
echo "::set-output name=remote::$(yarn info -s $(node -p -e "require('./package.json').name") version)" | |
- name: Publish package | |
if: ${{ steps.pkgver.outputs.local != steps.pkgver.outputs.remote }} | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_AUTH_TOKEN }} | |
package: ./shared/package.json | |
access: public | |
client: | |
name: Publish client | |
runs-on: ubuntu-latest | |
if: "contains(github.event.head_commit.message, 'Bump version')" | |
defaults: | |
run: | |
working-directory: ./client | |
steps: | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18.x | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Check package version | |
id: pkgver | |
run: | | |
echo "::set-output name=local::$(node -p -e "require('./package.json').version")" | |
echo "::set-output name=remote::$(yarn info -s $(node -p -e "require('./package.json').name") version)" | |
- name: Publish package | |
if: ${{ steps.pkgver.outputs.local != steps.pkgver.outputs.remote }} | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_AUTH_TOKEN }} | |
package: ./client/package.json | |
access: public | |
webview: | |
name: Publish webview | |
runs-on: ubuntu-latest | |
if: "contains(github.event.head_commit.message, 'Bump version')" | |
defaults: | |
run: | |
working-directory: ./webview | |
steps: | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18.x | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Check package version | |
id: pkgver | |
run: | | |
echo "::set-output name=local::$(node -p -e "require('./package.json').version")" | |
echo "::set-output name=remote::$(yarn info -s $(node -p -e "require('./package.json').name") version)" | |
- name: Publish package | |
if: ${{ steps.pkgver.outputs.local != steps.pkgver.outputs.remote }} | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_AUTH_TOKEN }} | |
package: ./webview/package.json | |
access: public | |
worker: | |
name: Publish worker | |
runs-on: ubuntu-latest | |
if: "contains(github.event.head_commit.message, 'Bump version')" | |
defaults: | |
run: | |
working-directory: ./worker | |
steps: | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18.x | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Check package version | |
id: pkgver | |
run: | | |
echo "::set-output name=local::$(node -p -e "require('./package.json').version")" | |
echo "::set-output name=remote::$(yarn info -s $(node -p -e "require('./package.json').name") version)" | |
- name: Publish package | |
if: ${{ steps.pkgver.outputs.local != steps.pkgver.outputs.remote }} | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_AUTH_TOKEN }} | |
package: ./worker/package.json | |
access: public | |
natives: | |
name: Publish natives | |
runs-on: ubuntu-latest | |
if: "contains(github.event.head_commit.message, 'Bump version')" | |
defaults: | |
run: | |
working-directory: ./natives | |
steps: | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18.x | |
- name: Set up .Net SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 5.0.x | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Check package version | |
id: pkgver | |
run: | | |
echo "::set-output name=local::$(node -p -e "require('./package.json').version")" | |
echo "::set-output name=remote::$(yarn info -s $(node -p -e "require('./package.json').name") version)" | |
- name: Checkout generator | |
if: ${{ steps.pkgver.outputs.local != steps.pkgver.outputs.remote }} | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
repository: altmp/altv-native-gen | |
ref: c40614e276bcbdd002cb4d78d6109c59d7884307 | |
path: ./gen | |
- name: Checkout nativedb | |
if: ${{ steps.pkgver.outputs.local != steps.pkgver.outputs.remote }} | |
run: | | |
mkdir "../nativedb" | |
curl "https://natives.altv.mp/natives" -A "AltPublicAgent" > "../nativedb/natives.json" | |
- name: Run generator | |
if: ${{ steps.pkgver.outputs.local != steps.pkgver.outputs.remote }} | |
run: dotnet run -p "../gen/Durty.AltV.NativesTypingsGenerator.Console" --disableHeader --nativesPath "../nativedb/natives.json" --outPath "./index.d.ts" --outIndent " " | |
- name: Commit changes | |
if: ${{ steps.pkgver.outputs.local != steps.pkgver.outputs.remote }} | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add "./index.d.ts" | |
git commit -m "chore: Update natives/index.d.ts" -m "Co-authored-by: $(git diff-tree ${{ github.sha }} --pretty='format:%an <%ae>' -s)" | |
- name: Push changes | |
if: ${{ steps.pkgver.outputs.local != steps.pkgver.outputs.remote }} | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish package | |
if: ${{ steps.pkgver.outputs.local != steps.pkgver.outputs.remote }} | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_AUTH_TOKEN }} | |
package: ./natives/package.json | |
access: public | |
server: | |
name: Publish server | |
runs-on: ubuntu-latest | |
if: "contains(github.event.head_commit.message, 'Bump version')" | |
defaults: | |
run: | |
working-directory: ./server | |
steps: | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18.x | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Check package version | |
id: pkgver | |
run: | | |
echo "::set-output name=local::$(node -p -e "require('./package.json').version")" | |
echo "::set-output name=remote::$(yarn info -s $(node -p -e "require('./package.json').name") version)" | |
- name: Publish package | |
if: ${{ steps.pkgver.outputs.local != steps.pkgver.outputs.remote }} | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_AUTH_TOKEN }} | |
package: ./server/package.json | |
access: public |