Commit c06694e2 authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

ci: move imgtool publishing to GH workflows



Disable imgtool publishing on Travis; update scripts to work on both
Travis and GH; add GH workflow for publishing.

Signed-off-by: default avatarFabio Utzig <fabio.utzig@nordicsemi.no>
parent 3236d75e
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
on:
  push:
    branches:
      - master

jobs:
  environment:
    name: Publish imgtool releases
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
    - name: Install publishing packages
      run: |
        export PATH="$HOME/.local/bin:$PATH"
        ./ci/imgtool_install.sh
    - name: Publish imgtool
      env:
        TWINE_TOKEN: ${{ secrets.TWINE_TOKEN }}
      run: |
        export PATH="$HOME/.local/bin:$PATH"
        ./ci/imgtool_run.sh
+6 −4
Original line number Diff line number Diff line
@@ -12,10 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if [[ $TRAVIS == "true" ]]; then
    if [[ $TRAVIS_PULL_REQUEST != "false" || $TRAVIS_BRANCH != "master" ]]; then
        echo "Either a PR or not \"master\" branch, exiting"
        exit 0
    fi
fi

pip3 install setuptools twine packaging
pip3 install --pre imgtool
pip3 install --pre imgtool --no-binary :all:
+7 −5
Original line number Diff line number Diff line
@@ -12,23 +12,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if [[ $TRAVIS == "true" ]]; then
    if [[ $TRAVIS_PULL_REQUEST != "false" || $TRAVIS_BRANCH != "master" ]]; then
        echo "Either a PR or not \"master\" branch, exiting"
        exit 0
    fi
fi

IMGTOOL_VER_PREFIX="\+imgtool_version = "
IMGTOOL_VER_FILE="imgtool/__init__.py"
DIST_DIR="dist"

if [[ -z "$TWINE_TOKEN" ]]; then
    echo "\$TWINE_TOKEN must be set in travis settings"
    echo "\$TWINE_TOKEN must be set in Travis or GH settings"
    exit 0
fi

cd scripts/

last_release=$(pip show imgtool | grep "Version: " | cut -d" " -f2)
last_release=$(pip3 show imgtool | grep "Version: " | cut -d" " -f2)
repo_version=$(grep "imgtool_version = " imgtool/__init__.py | sed 's/^.* = "\(.*\)"/\1/g')

python3 ../ci/compare_versions.py --old $last_release --new $repo_version