docs: add content read permission throughout #88
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
inputs: | |
release: | |
description: 'type "release" to create the release (main branch only)' | |
required: false | |
concurrency: | |
group: release | |
cancel-in-progress: true | |
jobs: | |
dryrun: | |
if: ${{ github.ref != 'refs/heads/main' || github.event.inputs.release != 'release' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🏗 Setup repo | |
uses: actions/checkout@v3 | |
- name: 🏗 Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: yarn | |
- name: 📦 Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: 📋 Dry-running release | |
run: yarn semantic-release --dry-run | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
publish: | |
if: ${{ github.ref == 'refs/heads/main' && github.event.inputs.release == 'release' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🏗 Setup repo | |
uses: actions/checkout@v3 | |
- name: 🏗 Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: yarn | |
- name: 📦 Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: 📋 Release code | |
run: yarn semantic-release | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
tags: | |
needs: publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🏗 Setup repo | |
uses: actions/checkout@v3 | |
- name: 🏗 Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: yarn | |
- name: 👷 Force repo to latest | |
runs: git fetch --all && git pull | |
- name: 📦 Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: 📦 Install semver | |
run: yarn add --dev semver | |
- name: 🕵️ Resolve major version | |
uses: actions/github-script@v6 | |
id: version | |
with: | |
result-encoding: string | |
script: | | |
const semver = require('semver') | |
const { version } = require('./package.json') | |
return semver.major(version) | |
- name: 🧹 Clean repo | |
run: git clean . -xdf && git reset --hard HEAD && git pull && git fetch --tags | |
- name: 📋 Update tags | |
run: git tag --force v${{ steps.version.outputs.result }} && git push --force --tags |