Skip to content

Commit 221904d

Browse files
committed
Fix create-release workflow
1 parent 36e4c85 commit 221904d

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,3 @@ jobs:
125125
- name: Build and Test
126126
run: |
127127
gradle clean installBuildTools build ${{ inputs.gradle_debug_params }}
128-

.github/workflows/create-release.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ jobs:
4040
- name: Extract tag and Details
4141
id: release
4242
run: |
43+
set -euo pipefail
4344
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
4445
TAG_NAME="${GITHUB_REF#refs/tags/}"
4546
elif [[ -n "${{ inputs.tag-name }}" ]]; then
4647
TAG_NAME="${{ inputs.tag-name }}"
4748
fi
49+
: "${TAG_NAME:?missing tag_name output}"
4850
echo "TAG-NAME: ${TAG_NAME}" >> $GITHUB_STEP_SUMMARY
4951
echo "tag_name=$(echo ${TAG_NAME})" >> "$GITHUB_OUTPUT"
5052
@@ -75,8 +77,7 @@ jobs:
7577
fi
7678
7779
build_and_test:
78-
if: ${{ inputs['pypi-publish'] }}
79-
needs: check_pypi
80+
needs: details
8081
runs-on: ubuntu-latest
8182
steps:
8283
- uses: actions/checkout@v4
@@ -118,7 +119,9 @@ jobs:
118119
pypi_publish:
119120
if: ${{ inputs['pypi-publish'] }}
120121
name: Upload release to PyPI
121-
needs: build_and_test
122+
needs:
123+
- check_pypi
124+
- build_and_test
122125
runs-on: ubuntu-latest
123126
environment:
124127
name: release
@@ -135,18 +138,22 @@ jobs:
135138

136139
github_release:
137140
name: Create GitHub Release
138-
needs: details
141+
needs:
142+
- details
143+
- build_and_test
139144
runs-on: ubuntu-latest
140145
permissions:
141146
contents: write
147+
env:
148+
TAG: ${{ needs.details.outputs.tag_name }}
142149
steps:
143150
- name: Checkout Code
144151
uses: actions/checkout@v4
145152
with:
146153
fetch-depth: 0
147154
- name: Create Changelog
148155
id: change-log
149-
uses: yorevs/hspylib/.github/actions/changelog@master
156+
uses: HS-Teams/hspylib/.github/actions/changelog@master
150157
with:
151158
tag-name: ${{ needs.details.outputs.tag_name }}
152159
- name: Download artifacts
@@ -160,8 +167,10 @@ jobs:
160167
env:
161168
GH_TOKEN: ${{ github.token }}
162169
run: |
170+
set -euo pipefail
171+
: "${TAG:?missing tag_name output}"
163172
echo "${{ steps.change-log.outputs.changelog }}" > changelog
164173
[[ "${{ inputs['pypi-publish'] }}" == 'true' ]] && assets="dist/*"
165-
gh release create ${{ needs.details.outputs.tag_name }} \
174+
gh release create "${TAG}" \
166175
--title "${{ vars.PACKAGE_NAME }}-${{ needs.details.outputs.tag_name }}-rc${{ github.run_number }}" \
167176
--notes-file changelog ${assets}

src/demo/features/rag/x_refs_demo.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
from askai.core.router.evaluation import resolve_x_refs
24
from askai.core.support.shared_instances import shared
35
from askai.core.support.utilities import display_text
@@ -29,6 +31,9 @@
2931

3032
from tokenizers.decoders import DecodeStream
3133
from transformers import AutoTokenizer
34+
from huggingface_hub import login
35+
HF_TOKEN = os.getenv('HF_TOKEN')
36+
login(token=HF_TOKEN)
3237
tok = AutoTokenizer.from_pretrained('meta-llama/Meta-Llama-3-8B-Instruct')
3338
stream = DecodeStream(skip_special_tokens=False)
3439

0 commit comments

Comments
 (0)