2022-10-26 07:30:16 +00:00
|
|
|
name: Release
|
|
|
|
permissions: read-all
|
|
|
|
|
|
|
|
on:
|
|
|
|
# For manual tests.
|
|
|
|
workflow_dispatch:
|
|
|
|
release:
|
|
|
|
types: [created]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish-npm:
|
|
|
|
name: Publish NPM
|
2022-10-26 23:41:17 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-10-26 07:30:16 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: '16.x'
|
|
|
|
registry-url: 'https://registry.npmjs.org'
|
2022-10-26 23:41:17 +00:00
|
|
|
|
2022-10-26 07:30:16 +00:00
|
|
|
- run: npm publish
|
|
|
|
env:
|
2022-10-26 07:40:43 +00:00
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
2022-10-26 22:17:21 +00:00
|
|
|
|
|
|
|
publish-pypi:
|
|
|
|
name: Publish PyPi
|
|
|
|
runs-on: ubuntu-latest
|
2022-10-26 23:02:38 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: ./python
|
2022-10-26 22:17:21 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '3.10'
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
|
|
|
python3 -m pip install --upgrade pip
|
|
|
|
python3 -m pip install setuptools wheel twine
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
python3 setup.py sdist bdist_wheel
|
|
|
|
|
|
|
|
- name: Upload to PyPi
|
|
|
|
run: |
|
|
|
|
python3 -m twine upload dist/*
|
|
|
|
env:
|
|
|
|
TWINE_USERNAME: __token__
|
|
|
|
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}
|
|
|
|
|
2022-10-26 23:36:35 +00:00
|
|
|
publish-nuget:
|
|
|
|
name: Publish NuGet
|
2022-10-27 00:15:51 +00:00
|
|
|
runs-on: windows-latest
|
2022-10-26 23:36:35 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: ./net/flatbuffers
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-dotnet@v3
|
|
|
|
with:
|
2022-10-27 00:15:51 +00:00
|
|
|
dotnet-version: '6.0.x'
|
2022-10-26 23:36:35 +00:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
dotnet build Google.FlatBuffers.csproj -c Release
|
|
|
|
|
|
|
|
- name: Pack
|
|
|
|
run: |
|
|
|
|
dotnet pack Google.FlatBuffers.csproj -c Release
|
|
|
|
|
|
|
|
- name: Upload to NuGet
|
|
|
|
run: |
|
2022-10-27 00:15:51 +00:00
|
|
|
dotnet nuget push .\bin\Release\Google.FlatBuffers.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
|
2022-10-26 22:17:21 +00:00
|
|
|
|
|
|
|
|