|
| 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/* |
0 commit comments