diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11161fd..9157881 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: build: runs-on: ubuntu-latest permissions: - contents: read + contents: write id-token: write steps: @@ -50,18 +50,19 @@ jobs: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} run: | mvn --batch-mode -P ssb-bip package + + - name: Upload assets to GitHub release + id: upload_jars + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | ARTIFACT_ID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout) VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "artifact_id=${ARTIFACT_ID}" >> $GITHUB_OUTPUT ARTIFACT_PATH=$(realpath ./target/$ARTIFACT_ID-$VERSION.jar) echo ${ARTIFACT_PATH} ls -al ${ARTIFACT_PATH} echo -n "artifact_path=${ARTIFACT_PATH}" >> $GITHUB_OUTPUT - - - name: Upload Assets - uses: shogo82148/actions-upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} - with: - upload_url: "https://uploads.github.com/repos/statisticsnorway/tink-fpe-java/releases/99443723/assets{?name,label}" - asset_path: ${{ steps.release_jar.outputs.artifact_glob }} - + gh version + gh release list + gh release upload v0.0.9 ${ARTIFACT_PATH}