chore: avoid downstream dependency runtime errors (#154) #226
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create release kysor binaries | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- '*' | |
jobs: | |
prepare: | |
name: 'Check kysor for release' | |
runs-on: ubuntu-latest | |
outputs: | |
output: ${{ steps.set_env.outputs.test }} | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@main | |
with: | |
ref: 'main' | |
- name: featch tags | |
run: git fetch --tags | |
- name: collect integrations names | |
run: | | |
cd integrations/ | |
echo "INTEGRATIONS=$(ls | jq --raw-input . | jq --slurp . | jq tostring)" >> $GITHUB_ENV | |
- name: set tag | |
run: echo "TAGS=$(git tag --points-at | jq --raw-input . | jq --slurp . | jq tostring)" >> $GITHUB_ENV | |
- id: output-tags | |
uses: actions/github-script@master | |
with: | |
script: | | |
const { TAGS } = process.env; | |
const KYSOR_TAG = 'kysor' | |
const tags = JSON.parse(JSON.parse(TAGS)); | |
const kysorTag = tags.find(it => it.trim().split('/')[1]?.split('@')[0] === KYSOR_TAG) | |
return kysorTag?.toString() ?? ''; | |
result-encoding: string | |
- name: print var | |
run: echo ${{steps.output-tags.outputs.result}} | |
- name: set | |
id: set_env | |
run: echo "::set-output name=test::${{steps.output-tags.outputs.result}}" | |
build: | |
name: 'Kysor build & release' | |
if: needs.prepare.outputs.output != '' | |
runs-on: ubuntu-latest | |
needs: prepare | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@main | |
with: | |
ref: 'main' | |
- name: install yarn | |
run: npm install --global yarn | |
- name: setup lerna | |
run: yarn setup | |
- name: print var | |
run: echo ${{steps.output-tag.outputs.result}} | |
- name: Build Binaries | |
run: | | |
cd tools/kysor | |
yarn build:binaries | |
cd out | |
zip kysor-linux-arm64.zip kysor-linux-arm64 | |
rm kysor-linux-arm64 | |
zip kysor-linux-x64.zip kysor-linux-x64 | |
rm kysor-linux-x64 | |
zip kysor-macos-x64.zip kysor-macos-x64 | |
rm kysor-macos-x64 | |
ls | |
- name: Generate Release Body | |
run: npx extract-changelog-release ${{ github.workspace }}/tools/kysor/CHANGELOG.md > RELEASE_BODY.md | |
- name: Publish the Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: RELEASE_BODY.md | |
tag_name: ${{ needs.prepare.outputs.output }} | |
files: ${{ github.workspace }}/tools/kysor/out/* | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |