mtcute/.forgejo/workflows/release.yaml

71 lines
2 KiB
YAML
Raw Normal View History

2023-10-31 21:17:39 +03:00
name: Run release
on:
workflow_dispatch:
inputs:
kind:
description: 'Release kind (major, minor, patch)'
required: true
2024-12-02 08:42:18 +03:00
default: 'auto'
2023-10-31 21:17:39 +03:00
type: choice
options:
2024-12-02 08:42:18 +03:00
- auto
2023-10-31 21:17:39 +03:00
- major
- minor
- patch
2024-04-27 11:14:52 +03:00
branch:
description: 'Branch to release from'
required: true
default: 'master'
2024-12-30 22:12:28 +03:00
type: string
2023-10-31 21:17:39 +03:00
jobs:
release:
2024-12-30 22:12:28 +03:00
runs-on: node22
2023-10-31 21:17:39 +03:00
permissions:
contents: write
packages: write
2024-12-02 08:42:18 +03:00
id-token: write
2023-10-31 21:17:39 +03:00
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.BOT_PAT }}
2024-04-27 11:14:52 +03:00
- if: ${{ github.event.inputs.branch != 'master' }}
run: git checkout ${{ github.event.inputs.branch }}
2024-12-11 07:37:19 +03:00
- uses: ./.forgejo/actions/init
2024-12-30 22:12:28 +03:00
- uses: https://github.com/denoland/setup-deno@v1
2024-12-02 08:42:18 +03:00
with:
deno-version: '2.0'
2023-10-31 21:17:39 +03:00
- name: Initialize configs
2025-01-02 02:28:20 +03:00
env:
GH_PRIVKEY: ${{ secrets.GH_PRIVKEY }}
2023-10-31 21:17:39 +03:00
run: |
git config user.name "mtcute-bot"
git config user.email mtcute-bot@tei.su
2025-01-02 02:28:20 +03:00
echo "$GH_PRIVKEY" > /tmp/bot-key
mkdir -p ~/.ssh
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
echo "Host github.com" >> ~/.ssh/config
echo " IdentityFile /tmp/bot-key" >> ~/.ssh/config
chmod 600 /tmp/bot-key
2025-01-01 08:06:51 +03:00
git remote add github git@github.com:mtcute/mtcute.git
2024-12-02 08:42:18 +03:00
- name: Run release
2023-10-31 21:17:39 +03:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2024-03-24 01:31:44 +03:00
run: |
2024-12-30 22:12:28 +03:00
pnpm exec fuman-build release \
2024-12-02 08:42:18 +03:00
--kind=${{ github.event.inputs.kind }} \
--with-npm \
--npm-token=${{ secrets.NPM_TOKEN }} \
2025-01-01 08:06:51 +03:00
--with-jsr \
--jsr-token=${{ secrets.JSR_TOKEN }} \
--git-extra-origins=github \
2024-12-30 22:12:28 +03:00
--with-github-release \
--github-repo=mtcute/mtcute \
--github-token=${{ secrets.GH_PAT }}