jan/.github/workflows/template-noti-discord-and-update-url-readme.yml
2025-03-18 13:06:17 +07:00

57 lines
1.7 KiB
YAML

name: noti-discord-and-update-url-readme
on:
workflow_call:
inputs:
ref:
required: true
type: string
default: 'refs/heads/main'
build_reason:
required: true
type: string
default: 'Nightly'
push_to_branch:
required: true
type: string
default: 'main'
new_version:
required: true
type: string
default: ''
# secrets:
# PAT_SERVICE_ACCOUNT:
# required: false
# DISCORD_WEBHOOK:
# required: false
jobs:
noti-discord-and-update-url-readme:
environment: production
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: '0'
token: ${{ secrets.PAT_SERVICE_ACCOUNT }}
ref: ${{ inputs.ref }}
- name: Set version to environment variable
run: |
echo "VERSION=${{ inputs.new_version }}" >> $GITHUB_ENV
- name: Notify Discord
uses: Ilshidur/action-discord@master
with:
args: |
Jan App ${{ inputs.build_reason }} build artifact version {{ VERSION }}:
- Windows: https://delta.jan.ai/nightly/jan-nightly-win-x64-{{ VERSION }}.exe
- macOS Universal: https://delta.jan.ai/nightly/jan-nightly-mac-universal-{{ VERSION }}.dmg
- Linux Deb: https://delta.jan.ai/nightly/jan-nightly-linux-amd64-{{ VERSION }}.deb
- Linux AppImage: https://delta.jan.ai/nightly/jan-nightly-linux-x86_64-{{ VERSION }}.AppImage
- Github action run: https://github.com/menloresearch/jan/actions/runs/{{ GITHUB_RUN_ID }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}