Skip to content

Bump rollup from 2.79.1 to 3.29.5 #59

Bump rollup from 2.79.1 to 3.29.5

Bump rollup from 2.79.1 to 3.29.5 #59

Workflow file for this run

name: Release automatically
on:
pull_request:
branches:
- main
types:
- closed
jobs:
release-from-pr:
name: Release from a PR that is marked with [new release]
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'new release')
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Fetch the version number 📝
id: fetch-version
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const package = require(`${process.env.GITHUB_WORKSPACE}/attractions/package.json`);
return `v${package.version}`;
- name: Fetch the changelog 📝
id: fetch-changelog
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const changelog = require('fs').readFileSync('CHANGELOG.md', { encoding: 'utf-8' }).split('\n');
const start = changelog.findIndex(line => line.startsWith('## '));
const end = changelog.findIndex((line, index) => line.startsWith('## ') && index > start);
return changelog.slice(start + 1, end).join('\n').trim();
- name: Create a release 🔖
uses: actions/github-script@v7
env:
CHANGELOG: ${{ steps.fetch-changelog.outputs.result }}
with:
script: |
await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: "${{ steps.fetch-version.outputs.result }}",
name: "${{ steps.fetch-version.outputs.result }}",
body: process.env.CHANGELOG,
});