From 2969dd861c7f2c9ae42cf377c9b168a4d1bac834 Mon Sep 17 00:00:00 2001 From: Florian Bezannier Date: Tue, 26 Apr 2022 23:14:36 +0200 Subject: [PATCH] ci: fix release --- .github/workflows/release.yml | 21 +++++++++++---------- .github/workflows/test.yml | 7 ++++++- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index acccb925..3c8479e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,12 +21,15 @@ jobs: sudo apt-get install libblas3 liblapack3 liblapack-dev libblas-dev gfortran libatlas-base-dev - name: Build and publish run: | - poetry version $(git describe --tags --abbrev=0) - poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }} + export PSACC_VERSION=$(git describe --tags --abbrev=0) + poetry version ${PSACC_VERSION} + poetry build + poetry publish --username __token__ --password ${{ secrets.PYPI_TOKEN }} + mv dist/psa_car_controller-${PSACC_VERSION:1}-py3-none-any.whl dist/psa_car_controller-0.0.0-py3-none-any.whl - uses: actions/upload-artifact@master with: name: wheel-package - path: dist/psa_car_controller-$(git describe --tags --abbrev=0)-py3-none-any.whl + path: dist/psa_car_controller-0.0.0-py3-none-any.whl push_to_registry: needs: create_release name: Push Docker image to Docker Hub @@ -46,11 +49,6 @@ jobs: TAGS="${DOCKER_IMAGE}:${VERSION}" fi echo ::set-output name=tags::${TAGS} - echo "PSACC_VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV - - uses: actions/download-artifact@master - with: - name: wheel-package - path: dist/psa_car_controller-$(git describe --tags --abbrev=0)-py3-none-any.whl - name: Set up QEMU uses: docker/setup-qemu-action@master with: @@ -60,6 +58,10 @@ jobs: uses: docker/setup-buildx-action@master - name: Check out the repo uses: actions/checkout@v2 + - uses: actions/download-artifact@master + with: + name: wheel-package + path: dist/psa_car_controller-0.0.0-py3-none-any.whl - name: Login to DockerHub uses: docker/login-action@v1 with: @@ -74,7 +76,6 @@ jobs: push: true tags: ${{ steps.prep.outputs.tags }} platforms: linux/amd64,linux/arm64,linux/arm/v7 - build-args: PSACC_VERSION=${{ env.PSACC_VERSION }} - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} + run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f327c191..d48f2f2a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,4 +43,9 @@ jobs: coverage run -m unittest || exit 11 coverage combine coverage report - [ -n "$CODACY_PROJECT_TOKEN" ] && coverage xml -o cobertura.xml && bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r cobertura.xml + if [ -n "$CODACY_PROJECT_TOKEN" ]; then + coverage xml -o cobertura.xml + bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r cobertura.xml + else + echo no CODACY_PROJECT_TOKEN + fi \ No newline at end of file