flatbuffers/.github/workflows/release.yml

153 lines
4.1 KiB
YAML
Raw Normal View History

name: Release
permissions: read-all
on:
# For manual tests.
workflow_dispatch:
release:
types: [published]
jobs:
publish-npm:
name: Publish NPM
2023-12-14 00:57:46 +00:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
2023-12-14 00:57:46 +00:00
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
2023-12-14 00:57:46 +00:00
- run: npm publish
env:
2022-10-26 07:40:43 +00:00
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2023-12-14 00:57:46 +00:00
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'
2023-12-14 00:57:46 +00:00
2022-10-26 22:17:21 +00:00
- name: Install Dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install setuptools wheel twine
2023-12-14 00:57:46 +00:00
2022-10-26 22:17:21 +00:00
- name: Build
run: |
python3 setup.py sdist bdist_wheel
2023-12-14 00:57:46 +00:00
2022-10-26 22:17:21 +00:00
- 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:
dotnet-version: '8.0.x'
2022-10-26 23:36:35 +00:00
- name: Build
run: |
dotnet build Google.FlatBuffers.csproj -c Release
2023-12-14 00:57:46 +00:00
2022-10-26 23:36:35 +00:00
- name: Pack
run: |
dotnet pack Google.FlatBuffers.csproj -c Release
2023-12-14 00:57:46 +00:00
2022-10-26 23:36:35 +00:00
- name: Upload to NuGet
run: |
2023-12-14 00:57:46 +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-27 05:27:20 +00:00
publish-maven:
name: Publish Maven
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./java
steps:
- uses: actions/checkout@v3
2023-12-14 00:57:46 +00:00
2022-10-27 05:27:20 +00:00
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'
2022-10-27 05:27:20 +00:00
server-id: ossrh
2022-10-27 05:37:11 +00:00
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE # this needs to be an env var
2023-12-14 00:57:46 +00:00
2022-10-27 05:27:20 +00:00
- name: Publish Maven
run: mvn --batch-mode clean deploy
env:
2022-10-27 05:37:11 +00:00
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
publish-maven-kotlin:
name: Publish Maven - Kotlin
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./kotlin
steps:
- uses: actions/checkout@v3
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE # this needs to be an env var
2023-12-14 00:57:46 +00:00
- name: Publish Kotlin Library on Maven
run: ./gradlew publishAllPublicationsToSonatypeRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
2023-12-14 00:57:46 +00:00
publish-crates:
name: Publish crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Publish Flatbuffers
2024-05-29 01:34:26 +00:00
uses: katyo/publish-crates@v2
with:
path: ./rust/flatbuffers
registry-token: ${{ secrets.CARGO_TOKEN }}
- name: Publish Flexbuffers
2024-05-29 01:34:26 +00:00
uses: katyo/publish-crates@v2
with:
path: ./rust/flexbuffers
registry-token: ${{ secrets.CARGO_TOKEN }}