Skip to content

Commit

Permalink
NO-ISSUE: Publish weekly JIT executor native packages with the "dev" …
Browse files Browse the repository at this point in the history
…tag and add the ability to manually trigger the workflow (apache#2004)

* Publish weekluy JIT executor native packages with the "dev" tag

* Add manual trigger to the JIT executor workflow job

* Add manual trigger to the JIT executor workflow job

* Fix TAG

* Fix TAG

* Remove conditional
  • Loading branch information
rodrigonull authored and pefernan committed Mar 11, 2024
1 parent 51e225b commit 4b25d6b
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions .github/workflows/publish-jitexecutor-native.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
name: "Publish jitexecutor-native"

on:
workflow_dispatch:
inputs:
kogito_runtime_version:
description: "Kogito Runtime version"
required: true
npm_version:
description: "NPM Version"
required: true
npm_tag:
description: "NPM Tag"
required: true
schedule:
- cron: '0 16 * * 0' # Every sunday at 4:00PM

Expand All @@ -21,10 +32,19 @@ jobs:
- name: Set version
id: version
run: |
VERSION="999-${{ steps.date.outputs.CURRENT_DATE }}"
echo "TAG=$VERSION" >> "$GITHUB_OUTPUT"
echo "PROJECT_VERSION=$VERSION-SNAPSHOT" >> "$GITHUB_OUTPUT"
echo "NPM_VERSION=999.0.0-${{ steps.date.outputs.CURRENT_DATE }}-SNAPSHOT" >> "$GITHUB_OUTPUT"
if [ ${{ github.event_name }} == "schedule" ]; then
VERSION="999-${{ steps.date.outputs.CURRENT_DATE }}"
echo "TAG=$VERSION" >> "$GITHUB_OUTPUT"
echo "PROJECT_VERSION=$VERSION-SNAPSHOT" >> "$GITHUB_OUTPUT"
echo "NPM_VERSION=999.0.0-${{ steps.date.outputs.CURRENT_DATE }}-SNAPSHOT" >> "$GITHUB_OUTPUT"
echo "NPM_TAG=dev" >> "$GITHUB_OUTPUT"
else
VERSION="${{ github.event.inputs.kogito_runtime_version }}"
echo "TAG=${VERSION//-SNAPSHOT/}" >> "$GITHUB_OUTPUT"
echo "PROJECT_VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "NPM_VERSION=${{ github.event.inputs.npm_version }}" >> "$GITHUB_OUTPUT"
echo "NPM_TAG=${{ github.event.inputs.npm_tag }}" >> "$GITHUB_OUTPUT"
fi
shell: bash

- name: "Set long paths for Windows"
Expand Down Expand Up @@ -116,6 +136,7 @@ jobs:
outputs:
package_version: ${{ steps.version.outputs.PROJECT_VERSION }}
npm_version: ${{ steps.version.outputs.NPM_VERSION }}
npm_tag: ${{ steps.version.outputs.NPM_TAG }}

pack_and_publish:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -152,4 +173,4 @@ jobs:
mv ./dist/win32/jitexecutor-runner-${{ needs.build_jitexecutor_native_binaries.outputs.package_version }}-runner.exe ./dist/win32/jitexecutor.exe
npm version ${{ needs.build_jitexecutor_native_binaries.outputs.npm_version }}
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npm publish --access public
npm publish --tag ${{ needs.build_jitexecutor_native_binaries.outputs.npm_tag }} --access public

0 comments on commit 4b25d6b

Please sign in to comment.