2023-08-08 23:59:44 +02:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
2023-08-09 21:43:50 +02:00
|
|
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
|
2023-08-08 23:59:44 +02:00
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
if: ${{ github.repository_owner == 'cloudflare' }}
|
|
|
|
name: Release
|
|
|
|
runs-on: ubuntu-latest
|
2023-08-09 22:17:25 +02:00
|
|
|
permissions:
|
2023-08-09 23:39:06 +02:00
|
|
|
id-token: write
|
2023-08-09 22:17:25 +02:00
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
issues: read
|
2023-08-08 23:59:44 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout Repo
|
|
|
|
uses: actions/checkout@v3
|
2023-10-30 22:26:24 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
fetch-tags: true
|
2023-08-08 23:59:44 +02:00
|
|
|
|
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2024-11-12 20:17:08 +01:00
|
|
|
# Pinned due to compatibility issues on 23.2.0
|
|
|
|
node-version: "22"
|
2023-08-08 23:59:44 +02:00
|
|
|
cache: "npm"
|
|
|
|
|
|
|
|
- name: Install modules
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- name: Create Version PR
|
|
|
|
id: changesets
|
|
|
|
uses: changesets/action@v1
|
|
|
|
with:
|
2023-08-09 21:43:40 +02:00
|
|
|
createGithubReleases: true
|
2023-08-10 23:46:29 +02:00
|
|
|
publish: npx changeset tag
|
2023-08-08 23:59:44 +02:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2023-08-24 22:35:32 +02:00
|
|
|
|
2023-08-31 17:21:30 +02:00
|
|
|
- name: Build action
|
2023-08-24 22:35:32 +02:00
|
|
|
if: steps.changesets.outputs.published == 'true'
|
2023-08-31 17:21:30 +02:00
|
|
|
run: npm run build
|
|
|
|
|
|
|
|
- name: Push dist-tags
|
|
|
|
if: steps.changesets.outputs.published == 'true'
|
|
|
|
uses: JasonEtco/build-and-tag-action@v2
|
2023-08-31 00:27:17 +02:00
|
|
|
with:
|
|
|
|
tag_name: v${{ fromJSON(steps.changesets.outputs.publishedPackages)[0].version }}
|
2023-08-24 22:35:32 +02:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ github.token }}
|