Update static.yml #346
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
on: | |
push: | |
branches: | |
- master | |
name: release-please | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
version_created: ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} | |
steps: | |
- uses: GoogleCloudPlatform/release-please-action@v3.0 | |
id: release | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
release-type: node | |
package-name: '@toaztr/specs' | |
deliver-npm: | |
runs-on: ubuntu-latest | |
needs: release-please | |
if: ${{ needs.release-please.outputs.release_created }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2.4.1 | |
with: | |
node-version: 15 | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/cache@v2.1.6 | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.OS }}-node-${{ hashFiles('package-lock.json') }} | |
- run: npm ci | |
- run: npx openapi bundle reference/*.yaml --ext json -o dist/toaztr | |
- run: cp dist/toaztr* pkg/npm/ | |
- run: npm version ${{ needs.release-please.outputs.version_created }} | |
working-directory: ./pkg/npm | |
- run: npm publish --access public | |
working-directory: ./pkg/npm | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
deliver-pypi: | |
runs-on: ubuntu-latest | |
needs: release-please | |
if: ${{ needs.release-please.outputs.release_created }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2.4.1 | |
with: | |
node-version: 15 | |
registry-url: 'https://registry.npmjs.org' | |
- uses: actions/cache@v2.1.6 | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.OS }}-node-${{ hashFiles('package-lock.json') }} | |
- run: npm ci | |
- run: npx openapi bundle reference/*.yaml --ext json -o dist/toaztr | |
- run: cp dist/toaztr* pkg/pypi/src/toaztr_specs/ | |
- uses: actions/setup-python@v2.2.2 | |
with: | |
python-version: '3.8' | |
- run: python -m pip install build twine --user | |
working-directory: ./pkg/pypi | |
- run: python -m build --sdist --wheel --outdir dist/ | |
working-directory: ./pkg/pypi | |
env: | |
PACKAGE_VERSION: ${{ needs.release-please.outputs.version_created }} | |
- run: python -m twine upload dist/* | |
working-directory: ./pkg/pypi | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} |