...
1name: Release
2permissions: read-all
3
4on:
5 # For manual tests.
6 workflow_dispatch:
7 release:
8 types: [created]
9
10jobs:
11 publish-npm:
12 name: Publish NPM
13 runs-on: ubuntu-latest
14 steps:
15 - uses: actions/checkout@v3
16 - uses: actions/setup-node@v3
17 with:
18 node-version: '16.x'
19 registry-url: 'https://registry.npmjs.org'
20
21 - run: npm publish
22 env:
23 NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24
25 publish-pypi:
26 name: Publish PyPi
27 runs-on: ubuntu-latest
28 defaults:
29 run:
30 working-directory: ./python
31 steps:
32 - uses: actions/checkout@v3
33 - uses: actions/setup-python@v4
34 with:
35 python-version: '3.10'
36
37 - name: Install Dependencies
38 run: |
39 python3 -m pip install --upgrade pip
40 python3 -m pip install setuptools wheel twine
41
42 - name: Build
43 run: |
44 python3 setup.py sdist bdist_wheel
45
46 - name: Upload to PyPi
47 run: |
48 python3 -m twine upload dist/*
49 env:
50 TWINE_USERNAME: __token__
51 TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}
52
53 publish-nuget:
54 name: Publish NuGet
55 runs-on: windows-latest
56 defaults:
57 run:
58 working-directory: ./net/flatbuffers
59 steps:
60 - uses: actions/checkout@v3
61 - uses: actions/setup-dotnet@v3
62 with:
63 dotnet-version: '6.0.x'
64
65 - name: Build
66 run: |
67 dotnet build Google.FlatBuffers.csproj -c Release
68
69 - name: Pack
70 run: |
71 dotnet pack Google.FlatBuffers.csproj -c Release
72
73 - name: Upload to NuGet
74 run: |
75 dotnet nuget push .\bin\Release\Google.FlatBuffers.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
76
77 publish-maven:
78 name: Publish Maven
79 runs-on: ubuntu-latest
80 defaults:
81 run:
82 working-directory: ./java
83 steps:
84 - uses: actions/checkout@v3
85
86 - name: Set up Maven Central Repository
87 uses: actions/setup-java@v3
88 with:
89 java-version: '11'
90 distribution: 'adopt'
91 cache: 'maven'
92 server-id: ossrh
93 server-username: OSSRH_USERNAME
94 server-password: OSSRH_PASSWORD
95 gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
96 gpg-passphrase: MAVEN_GPG_PASSPHRASE # this needs to be an env var
97
98 - name: Publish Maven
99 run: mvn --batch-mode clean deploy
100 env:
101 OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
102 OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
103 MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
104
105
106
View as plain text