This commit is contained in:
60
.gitea/workflows/release.yaml
Normal file
60
.gitea/workflows/release.yaml
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Generate and Release Protos
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Get Version
|
||||
id: get_version
|
||||
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: bufbuild/buf-setup-action@v1
|
||||
|
||||
- name: Generate Code
|
||||
run: buf generate
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '18.18.x'
|
||||
registry-url: 'https://git.fjla.uk/api/packages/owlboard/npm'
|
||||
scope: '@owlboard'
|
||||
|
||||
- name: Publish TS
|
||||
working-directory: gen/ts
|
||||
run: |
|
||||
npm init -y
|
||||
jq '.name = "@owlboard/backend-data-contracts" |
|
||||
.version = "${{ steps.get_version.outputs.VERSION }}" |
|
||||
.description = "Generated Protobuf types for data ingress services" |
|
||||
.repository = {
|
||||
"type": "git",
|
||||
"url": "git+https://${{ github.server_url }}/${{ github.repository }}.git"
|
||||
} |
|
||||
.bugs = {
|
||||
"url": "https://${{ github.server_url }}/${{ github.repository }}/issues"
|
||||
} |
|
||||
.homepage = "https://${{ github.server_url }}/${{ github.repository }}#readme"' \
|
||||
package.json > temp.json && mv temp.json package.json
|
||||
npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_PUSH }}
|
||||
|
||||
- name: Commit Generated Go
|
||||
run: |
|
||||
git config user.name "owlbot"
|
||||
git config user.email "owlbot@owlboard.info"
|
||||
git add gen/go/*.go
|
||||
git commit -m "OwlBot: Generated go types for ${{ steps.get_version.outputs.VERSION }}"
|
||||
git diff-index --quiet HEAD || git commit -m "OwlBot: Generated go types for ${{ steps.get_version.outputs.VERSION }}"
|
||||
git push origin HEAD:refs/tags/${{ github.ref_name }} --force
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.REPO_PUSH }}
|
||||
Reference in New Issue
Block a user