Skip to content

Updated release script #24

Updated release script

Updated release script #24

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
repository_dispatch:
types: [test_release]
jobs:
check:
runs-on: ubuntu-latest
outputs:
is_tag: ${{ steps.check.outputs.is_tag }}
steps:
- name: Check if it's a tagged release
id: check
run: |
REF=${{ github.ref }}
URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${REF##*/}"
StatusCode=$(curl -o /dev/null -I -L -s -w "%{http_code}" -X GET -G $URL)
echo $StatusCode
if [[ "$StatusCode" == 200 ]]; then
echo "This is tagged release!"
echo "IS_TAG=no" >> $GITHUB_OUTPUT
else
echo "This is a tag not release!"
echo "IS_TAG=yes" >> $GITHUB_OUTPUT
fi
build:
runs-on: ubuntu-latest
container: setsoft/kicad_pybuild:latest
needs: check
if: ${{ needs.check.outputs.IS_TAG == 'yes' }}
outputs:
DEB_NAME: ${{ steps.mdeb.outputs.DEB_NAME }}
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build
id: mdeb
run: |
make deb
mv ../*.deb .
echo "DEB_NAME="`ls *.deb` >> $GITHUB_OUTPUT
mkdir output
mv *.deb output
- name: Store
uses: actions/upload-artifact@v4
with:
name: package
path: output
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Retrieve
uses: actions/download-artifact@v4
with:
name: package
- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRAFT_RELEASE: "false"
PRE_RELEASE: "false"
CHANGELOG_FILE: "CHANGELOG.md"
with:
args: |
${{needs.build.outputs.DEB_NAME}}
- name: Trigger kicad_auto image build
run: |
curl -X POST -u "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.v3+json" -H "Content-Type: application/json" https://api.github.com/repos/INTI-CMNB/KiBot/dispatches --data '{"event_type": "refresh_images_pre"}'