Skip to content

fix: zip archives of binaries (#106) #176

fix: zip archives of binaries (#106)

fix: zip archives of binaries (#106) #176

name: Create release binaries
on:
push:
branches: [main]
tags:
- "*"
jobs:
prepare:
name: "Check integrations 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: fetch 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 { INTEGRATIONS, TAGS } = process.env;
console.log(INTEGRATIONS);
console.log(TAGS);
const integrations = JSON.parse(JSON.parse(INTEGRATIONS));
const tags = JSON.parse(JSON.parse(TAGS));
const selectedTags = tags.filter(it => integrations.includes(it.trim().split('/')[1]?.split('@')[0]))
return JSON.stringify(JSON.stringify(selectedTags))
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:
if: needs.prepare.outputs.output != '[]'
runs-on: ubuntu-latest
name: "Integrations build & release"
needs: prepare
strategy:
matrix:
tag: ${{fromJSON(needs.prepare.outputs.output)}}
steps:
- name: Checkout the repository
uses: actions/checkout@main
with:
ref: "main"
- name: set integration name
run: echo "INTEGRATION_NAME=$(echo ${{ matrix.tag }} | awk -F'[/@]' '{print $3}' | sed 's/ *$//g')" >> $GITHUB_ENV
- name: install yarn
run: npm install --global yarn
- name: setup lerna
run: yarn setup
- name: print integration name
run: echo ${{ env.INTEGRATION_NAME }}
- name: Build Binaries
run: |
cd integrations/${{ env.INTEGRATION_NAME }}
ls
yarn build:binaries
cd ..
- name: Generate Release Body
run: npx extract-changelog-release ${{ github.workspace }}/integrations/${{env.INTEGRATION_NAME}}/CHANGELOG.md > RELEASE_BODY.md
- name: Publish the Release
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE_BODY.md
tag_name: ${{ matrix.tag }}
files: integrations/${{env.INTEGRATION_NAME}}/out/*
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}