Skip to content

Commit 580d16d

Browse files
artemrysArtem Rys
authored andcommitted
ci: fix release
1 parent d4afe17 commit 580d16d

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed

.github/workflows/build-test-release.yml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ jobs:
217217
path: test-results
218218

219219
publish:
220-
if: always()
220+
name: Build Release
221221
needs:
222222
- compliance-dependencies
223223
- compliance-copyrights
@@ -229,41 +229,39 @@ jobs:
229229
- run-unit-tests
230230
- test-splunk
231231
runs-on: ubuntu-latest
232-
env:
233-
NEEDS: ${{ toJson(needs) }}
234232
steps:
235-
- name: check if tests have passed or skipped
236-
if: github.event_name != 'pull_request'
237-
id: check
238-
shell: bash
239-
run: |
240-
RUN_PUBLISH=$(echo "$NEEDS" | jq ".[] | select( ( .result != \"skipped\" ) and .result != \"success\" ) | length == 0")
241-
if [[ $RUN_PUBLISH != *'false'* ]]
242-
then
243-
echo "::set-output name=run-publish::true"
244-
else
245-
echo "::set-output name=run-publish::false"
246-
fi
247-
- name: exit without publish
248-
if: ${{ steps.check.outputs.run-publish == 'false' || github.event_name == 'pull_request'}}
249-
run: |
250-
echo " some test job failed. "
251-
exit 1
252-
- name: Checkout
253-
uses: actions/checkout@v2
233+
- uses: actions/checkout@v2
254234
with:
255235
submodules: false
236+
# Very important: semantic-release won't trigger a tagged
237+
# build if this is not set false
256238
persist-credentials: false
239+
- name: Setup python
240+
uses: actions/setup-python@v2
241+
with:
242+
python-version: "3.7"
243+
- name: Install Poetry
244+
run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
245+
- name: Install Code
246+
run: |
247+
# shellcheck disable=SC1090
248+
source "$HOME/.poetry/env"
249+
poetry install
250+
- name: Build
251+
run: |
252+
# shellcheck disable=SC1090
253+
source "$HOME/.poetry/env"
254+
poetry build
257255
- name: Semantic Release
258-
uses: cycjimmy/semantic-release-action@v2.5.4
256+
uses: cycjimmy/semantic-release-action@v2.6.0
259257
with:
260258
semantic_version: 17
261259
extra_plugins: |
262260
@semantic-release/exec
263261
@semantic-release/git
264262
@google/semantic-release-replace-plugin
265263
env:
266-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }}
264+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
267265
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
268266
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
269267

0 commit comments

Comments
 (0)