Skip to content

Commit 5f853b7

Browse files
committed
automate release files as github workflow
automate check release version keep in sync - git tag - ./sendto_silhouette.py --version - sendto_silhouette.inx: about_version
1 parent a214ef5 commit 5f853b7

File tree

4 files changed

+61
-59
lines changed

4 files changed

+61
-59
lines changed

.github/workflows/build-deb.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
name: Create Release Package
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: 🐧 Install Inkscape
16+
run: |
17+
sudo add-apt-repository ppa:inkscape.dev/stable -y # inkscape 1.2 from https://launchpad.net/~inkscape.dev/+archive/ubuntu/stable
18+
sudo apt-get update
19+
sudo apt-get -y install inkscape
20+
sudo apt-get -y install checkinstall libxml-xpath-perl # xpath
21+
inkscape --version
22+
python -m pip install --upgrade pip
23+
pip install -r requirements.txt
24+
- name: Branch name
25+
id: branch_name
26+
run: |
27+
echo ::set-output name=TAG_VERSION::$( echo ${GITHUB_REF#refs/tags/} | sed -e 's/^v//' )
28+
echo ::set-output name=SOURCE_VERSION::$( python ./sendto_silhouette.py --version )
29+
echo ::set-output name=INX_VERSION::$( xpath -q -e '//*[@name="about_version"]/text()' sendto_silhouette.inx | sed -e 's/^version //i' )
30+
- name: Version Check
31+
env:
32+
TAG_VERSION: ${{ steps.branch_name.outputs.TAG_VERSION }}
33+
SOURCE_VERSION: ${{ steps.branch_name.outputs.SOURCE_VERSION }}
34+
INX_VERSION: ${{ steps.branch_name.outputs.INX_VERSION }}
35+
run: |
36+
echo "::notice::tag version: $TAG_VERSION"
37+
echo "::notice::source version: $SOURCE_VERSION"
38+
echo "::notice::inx version: $INX_VERSION"
39+
[ "$SOURCE_VERSION" == "$INX_VERSION" ] || ( echo "::error::Error: source version and .inx version differ" && exit 1 )
40+
[ "$SOURCE_VERSION" == "$TAG_VERSION" ] || ( echo "::error::Error: source version and git tag differ" && exit 1 )
41+
- name: Build Release Package
42+
run: |
43+
make dist
44+
# - name: Upload .deb Package
45+
# uses: actions/upload-artifact@v3
46+
# with:
47+
# name: inkscape-silhouette_${{ steps.branch_name.outputs.SOURCE_SOURCE_VERSION }}-1_all.deb
48+
# path: distribute/out/inkscape-silhouette_${{ steps.branch_name.outputs.SOURCE_SOURCE_VERSION }}-1_all.deb
49+
- name: Release
50+
uses: softprops/action-gh-release@v1
51+
if: startsWith(github.ref, 'refs/tags/')
52+
with:
53+
draft: true
54+
files: |
55+
distribute/out/*

distribute/distribute.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
#!/bin/bash
2-
echo "Determining Version:"
3-
VERSION=$(python3 ../sendto_silhouette.py --version)
4-
52
test -e /usr/bin/xpath || sudo apt-get install libxml-xpath-perl
63
test -e /usr/bin/checkinstall || sudo apt-get install checkinstall
74
#
8-
# grep Version ../*.inx
9-
xpath -q -e '//param[@name="about_version"]/text()' ../sendto_silhouette.inx
10-
echo "Version should be: \"$VERSION\""
5+
VERSION=$( python3 ../sendto_silhouette.py --version )
6+
INX_VERSION=$( xpath -q -e '//*[@name="about_version"]/text()' ../sendto_silhouette.inx | sed -e 's/^version //i' ) # grep Version ../*.inx
7+
echo "Source version is: \"$VERSION\""
8+
echo "INX version is: \"$INX_VERSION\""
9+
test "$VERSION" = "$INX_VERSION" || ( echo "Error: python source and .inx version differ" && exit 1 )
1110

1211

1312

sendto_silhouette.inx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Always use the least amount of blade possible.
172172
<page name='about' _gui-text='About'>
173173
<label>inkscape-silhouette extension from https://github.com/fablabnbg/inkscape-silhouette by Jürgen Weigert [juergen@fabmail.org] and contributors</label>
174174
<!-- Keep in sync with sendto_silhouette.py line 94 __version__ = ... -->
175-
<label>Version 1.25</label>
175+
<label name='about_version'>Version 1.25</label>
176176
</page>
177177
</param>
178178

0 commit comments

Comments
 (0)