-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github workflows for typescript language bindings
- Loading branch information
1 parent
092e301
commit 12fb18a
Showing
2 changed files
with
75 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: GBFS Typescript Language Bindings - Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build-publish: | ||
name: build-publish-job | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./models/typescript | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Publish to npm | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
|
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: GBFS Typescript Language Bindings - PR Check | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "models/typescript/**" | ||
|
||
jobs: | ||
check-versions: | ||
name: check-version-job | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
|
||
- name: Get current local version | ||
id: get_current_local_version | ||
run: echo "version=$(jq -r '.version' models/typescript/package.json)" >> $GITHUB_OUTPUT | ||
|
||
- name: Get version on master | ||
id: get_master_version | ||
run: echo "master-version=$(jq -r '.version' jq -r '.version' master/models/typescript/package.json)" >> $GITHUB_OUTPUT | ||
|
||
- name: Compare versions | ||
run: | | ||
current_version="${{ steps.get_current_local_version.outputs.version }}" | ||
master_version="${{ steps.get_master_version.outputs.master-version }}" | ||
if [ "$current_version" != "$master_version" ]; then | ||
echo "Versions are different:" | ||
echo "Current version: $current_version" | ||
echo "Version on master: $master_version" | ||
else | ||
echo "Versions are the same: $current_version" | ||
echo "Please update the package.json version so that your changes will be published." | ||
exit 1 | ||
fi | ||
|