Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
ci: use azury's log (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
boywithkeyboard committed Jul 8, 2023
1 parent ec82cae commit 49914ba
Showing 1 changed file with 6 additions and 28 deletions.
34 changes: 6 additions & 28 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,12 @@ jobs:
publish:
runs-on: 'ubuntu-latest'

permissions:
contents: 'write'
pull-requests: 'read'

steps:
- uses: 'actions/checkout@v3'

- name: 'grab tag'
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: 'publish release'
uses: 'actions/github-script@v6'
with:
script: |
const { readFile } = require('node:fs/promises')
let changelog = await readFile('./changelog.md', { encoding: 'utf-8' })
const startIndex = changelog.indexOf(`## [${process.env.TAG}]`) + `## [${process.env.TAG}](https://github.com/azurystudio/cheetah/releases/tag/${process.env.TAG})\n\n`.length
changelog = changelog.substring(startIndex)
const endIndex = changelog.indexOf('\n\n## [')
changelog = changelog.substring(0, endIndex < 0 ? undefined : endIndex)
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: process.env.TAG,
name: process.env.TAG,
body: changelog,
draft: false,
prerelease: false
})
- name: 'Publish Release'
uses: 'azurystudio/log@v1'

0 comments on commit 49914ba

Please sign in to comment.