mirror of
https://github.com/lockin-bot/react-telegram.git
synced 2026-01-12 22:27:38 +08:00
Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v7...v8) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
82 lines
2.4 KiB
YAML
82 lines
2.4 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
# This workflow requires NPM_TOKEN to be set as a repository secret
|
|
# To add the secret:
|
|
# 1. Go to Settings > Secrets and variables > Actions
|
|
# 2. Click "New repository secret"
|
|
# 3. Name: NPM_TOKEN
|
|
# 4. Value: Your npm access token from https://www.npmjs.com/settings/your-username/tokens
|
|
|
|
jobs:
|
|
release:
|
|
name: Release with Changesets
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
id-token: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Create Release Pull Request or Publish
|
|
id: changesets
|
|
uses: changesets/action@v1
|
|
with:
|
|
publish: bun run release
|
|
version: bun run version
|
|
commit: 'chore: update versions'
|
|
title: 'chore: update versions'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: Build packages before publish
|
|
if: steps.changesets.outputs.published == 'true'
|
|
run: |
|
|
bun run build:core
|
|
bun run build:adapter
|
|
|
|
- name: Publish packages
|
|
if: steps.changesets.outputs.published == 'true'
|
|
run: |
|
|
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
|
cd packages/core && npm publish --access public
|
|
cd ../mtcute-adapter && npm publish --access public
|
|
env:
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: Create GitHub Release
|
|
if: steps.changesets.outputs.published == 'true'
|
|
uses: actions/github-script@v8
|
|
with:
|
|
script: |
|
|
const { owner, repo } = context.repo;
|
|
const tagName = `v${require('./package.json').version}`;
|
|
await github.rest.repos.createRelease({
|
|
owner,
|
|
repo,
|
|
tag_name: tagName,
|
|
name: tagName,
|
|
draft: false,
|
|
prerelease: false,
|
|
generate_release_notes: true
|
|
}); |