Skip to content

2.5.1

2.5.1 #36

Workflow file for this run

name: API Clients
on:
push:
branches:
- main
jobs:
build-javascript:
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build and Deploy πŸš€
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm install
npm run generate-javascript
git clone https://[email protected]/URLR/urlr-javascript clones/urlr-javascript &> /dev/null
rsync -avI --delete --exclude='.git/' clients/urlr-javascript/ clones/urlr-javascript
cd clones/urlr-javascript
git status --verbose
if [ -n "$(git status --porcelain)" ]; then
git config --global user.email "[email protected]"
git config --global user.name "Hugo Posnic"
git add .
git commit --message "Deploying from urlr/api-clients-generation@${GITHUB_SHA::8}"
PACKAGE_VERSION=$(awk '/- Package version:/{print $NF}' README.md)
git tag -a $PACKAGE_VERSION -m $PACKAGE_VERSION || true
git push --tags origin main
npm config set //registry.npmjs.org/:_authToken $NODE_AUTH_TOKEN
npm publish
else
echo " No changes, skipping."
fi
build-php:
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build and Deploy πŸš€
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
run: |
npm install
npm run generate-php
git clone https://[email protected]/URLR/urlr-php clones/urlr-php &> /dev/null
rsync -avI --delete --exclude='.git/' clients/urlr-php/ clones/urlr-php
cd clones/urlr-php
git status --verbose
if [ -n "$(git status --porcelain)" ]; then
git config --global user.email "[email protected]"
git config --global user.name "Hugo Posnic"
git add .
git commit --message "Deploying from urlr/api-clients-generation@${GITHUB_SHA::8}"
PACKAGE_VERSION=$(awk '/- Package version:/{print $NF}' README.md)
git tag -a $PACKAGE_VERSION -m $PACKAGE_VERSION || true
git push --tags origin main
else
echo " No changes, skipping."
fi
build-python:
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Build and Deploy πŸš€
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: 1
run: |
npm install
npm run generate-python
git clone https://[email protected]/URLR/urlr-python clones/urlr-python &> /dev/null
rsync -avI --delete --exclude='.git/' clients/urlr-python/ clones/urlr-python
cd clones/urlr-python
git status --verbose
if [ -n "$(git status --porcelain)" ]; then
git config --global user.email "[email protected]"
git config --global user.name "Hugo Posnic"
git add .
git commit --message "Deploying from urlr/api-clients-generation@${GITHUB_SHA::8}"
PACKAGE_VERSION=$(awk '/- Package version:/{print $NF}' README.md)
git tag -a $PACKAGE_VERSION -m $PACKAGE_VERSION || true
git push --tags origin main
python -m pip install --upgrade pip
pip install twine build
python -m build
twine upload dist/*
else
echo " No changes, skipping."
fi