diff --git a/.github/workflows/build-deb.yml b/.github/workflows/build-deb.yml deleted file mode 100644 index 42d6b4a7..00000000 --- a/.github/workflows/build-deb.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Build .deb - -on: - push: - tags: - - 'v*' - -jobs: - package: - name: Create .deb - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.9 - uses: actions/setup-python@v3 - with: - python-version: 3.9 - - name: 🐧 install Inkscape - run: | - sudo add-apt-repository ppa:inkscape.dev/stable -y # inkscape 1.1 from https://launchpad.net/~inkscape.dev/+archive/ubuntu/stable - sudo apt-get update - sudo apt-get -y install inkscape - python -m pip install --upgrade pip - pip install -r requirements.txt - - name: Branch name - id: branch_name - run: | - echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/} - echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/} - echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} - echo ::set-output name=SOURCE_TAG_VERSION::$( echo ${GITHUB_REF#refs/tags/} | sed -e 's/^v//' ) - echo ::set-output name=SOURCE_SOURCE_VERSION::$( python3 ./sendto_silhouette.py --version ) - - name: build .deb Package - run: | - make dist -# - name: branch_version -# env: -# SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }} -# SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }} -# SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} -# SOURCE_TAG_VERSION: ${{ steps.branch_name.outputs.SOURCE_TAG_VERSION }} -# run: | -# echo $SOURCE_NAME -# echo $SOURCE_BRANCH -# echo $SOURCE_TAG -# echo $SOURCE_TAG_VERSION - - 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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..66d64c7b --- /dev/null +++ b/.github/workflows/release.yml @@ -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/* diff --git a/distribute/distribute.sh b/distribute/distribute.sh index b81c69ee..e6d47457 100755 --- a/distribute/distribute.sh +++ b/distribute/distribute.sh @@ -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 ) diff --git a/sendto_silhouette.inx b/sendto_silhouette.inx index 657d946e..ffb2a2bf 100644 --- a/sendto_silhouette.inx +++ b/sendto_silhouette.inx @@ -172,7 +172,7 @@ Always use the least amount of blade possible. - +