Skip to content

Commit

Permalink
automate release files as github workflow
Browse files Browse the repository at this point in the history
automate check release version
keep in sync
- git tag
- ./sendto_silhouette.py --version
- sendto_silhouette.inx: about_version
  • Loading branch information
t0b3 committed May 28, 2022
1 parent a214ef5 commit 5f853b7
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 59 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/build-deb.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
name: Create Release Package
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: 🐧 Install Inkscape
run: |
sudo add-apt-repository ppa:inkscape.dev/stable -y # inkscape 1.2 from https://launchpad.net/~inkscape.dev/+archive/ubuntu/stable
sudo apt-get update
sudo apt-get -y install inkscape
sudo apt-get -y install checkinstall libxml-xpath-perl # xpath
inkscape --version
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Branch name
id: branch_name
run: |
echo ::set-output name=TAG_VERSION::$( echo ${GITHUB_REF#refs/tags/} | sed -e 's/^v//' )
echo ::set-output name=SOURCE_VERSION::$( python ./sendto_silhouette.py --version )
echo ::set-output name=INX_VERSION::$( xpath -q -e '//*[@name="about_version"]/text()' sendto_silhouette.inx | sed -e 's/^version //i' )
- name: Version Check
env:
TAG_VERSION: ${{ steps.branch_name.outputs.TAG_VERSION }}
SOURCE_VERSION: ${{ steps.branch_name.outputs.SOURCE_VERSION }}
INX_VERSION: ${{ steps.branch_name.outputs.INX_VERSION }}
run: |
echo "::notice::tag version: $TAG_VERSION"
echo "::notice::source version: $SOURCE_VERSION"
echo "::notice::inx version: $INX_VERSION"
[ "$SOURCE_VERSION" == "$INX_VERSION" ] || ( echo "::error::Error: source version and .inx version differ" && exit 1 )
[ "$SOURCE_VERSION" == "$TAG_VERSION" ] || ( echo "::error::Error: source version and git tag differ" && exit 1 )
- name: Build Release Package
run: |
make dist
# - name: Upload .deb Package
# uses: actions/upload-artifact@v3
# with:
# name: inkscape-silhouette_${{ steps.branch_name.outputs.SOURCE_SOURCE_VERSION }}-1_all.deb
# path: distribute/out/inkscape-silhouette_${{ steps.branch_name.outputs.SOURCE_SOURCE_VERSION }}-1_all.deb
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
distribute/out/*
11 changes: 5 additions & 6 deletions distribute/distribute.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/bin/bash
echo "Determining Version:"
VERSION=$(python3 ../sendto_silhouette.py --version)

test -e /usr/bin/xpath || sudo apt-get install libxml-xpath-perl
test -e /usr/bin/checkinstall || sudo apt-get install checkinstall
#
# grep Version ../*.inx
xpath -q -e '//param[@name="about_version"]/text()' ../sendto_silhouette.inx
echo "Version should be: \"$VERSION\""
VERSION=$( python3 ../sendto_silhouette.py --version )
INX_VERSION=$( xpath -q -e '//*[@name="about_version"]/text()' ../sendto_silhouette.inx | sed -e 's/^version //i' ) # grep Version ../*.inx
echo "Source version is: \"$VERSION\""
echo "INX version is: \"$INX_VERSION\""
test "$VERSION" = "$INX_VERSION" || ( echo "Error: python source and .inx version differ" && exit 1 )



Expand Down
2 changes: 1 addition & 1 deletion sendto_silhouette.inx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Always use the least amount of blade possible.
<page name='about' _gui-text='About'>
<label>inkscape-silhouette extension from https://github.com/fablabnbg/inkscape-silhouette by Jürgen Weigert [[email protected]] and contributors</label>
<!-- Keep in sync with sendto_silhouette.py line 94 __version__ = ... -->
<label>Version 1.25</label>
<label name='about_version'>Version 1.25</label>
</page>
</param>

Expand Down

0 comments on commit 5f853b7

Please sign in to comment.