Skip to content

v0.28.0-rc4

v0.28.0-rc4 #122

Workflow file for this run

# name of the action
name: api-spec
# trigger on release events
on:
release:
types: [created]
permissions:
contents: read
# pipeline to execute
jobs:
schema:
runs-on: ubuntu-latest
permissions:
contents: write # for actions/github-script to attach files to release artifacts
steps:
- name: clone
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: install go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
# use version from go.mod file
go-version-file: "go.mod"
cache: true
check-latest: true
- name: tags
run: |
git fetch --tags
- name: create spec
run: |
make spec-install
make spec
- name: upload api spec
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
retries: 3
script: |
const fs = require('fs');
const path = './api-spec.json';
const name = 'api-spec.json';
const fileContent = fs.readFileSync(path);
const response = await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: context.payload.release.id,
name: name,
data: fileContent,
headers: {
'content-type': 'text/plain',
'content-length': fileContent.length,
},
});
core.info(`Uploaded asset: ${response.data.browser_download_url}`);