Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
name: Publish documentation

on:
pull_request:
types: [closed]
branches: ["main", "next"]
push:
branches: ["main"]

permissions:
contents: write
id-token: write
pages: write

concurrency:
group: pages-${{ github.workflow }}-${{ github.ref }}
group: documentation-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build Amicons package
if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.full_name == github.repository && (github.event.pull_request.base.ref == 'next' || (github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.labels.*.name, 'docs')))
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
Expand Down Expand Up @@ -60,7 +58,6 @@ jobs:

docs_check:
name: Docs linting and formatting
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.labels.*.name, 'docs') && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -87,8 +84,7 @@ jobs:

deploy-docs:
name: Deploy to GitHub Pages
needs: [docs_check]
if: github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.labels.*.name, 'docs') && github.event.pull_request.head.repo.full_name == github.repository
needs: [build, docs_check]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
89 changes: 6 additions & 83 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
pages: write

concurrency:
group: pages-${{ github.workflow }}-${{ github.ref }}
group: release-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -58,37 +58,10 @@ jobs:
amicons/studio384-amicons-*.tgz
amicons-${{ steps.version.outputs.version }}-icons.zip

docs_check:
name: Docs linting and formatting
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.labels.*.name, 'release') && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up pnpm
uses: pnpm/action-setup@v5
with:
version: 10.33.0
- name: Set up Node 24
uses: actions/setup-node@v6
with:
node-version: 24.x
cache: "pnpm"
cache-dependency-path: docs/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Check formatting
run: pnpm format
- name: Lint
run: pnpm lint

release:
name: Release Amicons stable
needs: [build, docs_check]
if: github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.labels.*.name, 'release') && github.event.pull_request.head.repo.full_name == github.repository
needs: build
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.labels.*.name, 'release') && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Download artifacts
Expand All @@ -100,69 +73,23 @@ jobs:
with:
node-version: 24.x
registry-url: "https://registry.npmjs.org"
- name: Write release notes
env:
BODY: ${{ github.event.pull_request.body }}
run: printf '%s' "$BODY" > release-notes.md
- name: Create GitHub release
run: |
gh release create v${{ needs.build.outputs.version }} \
--repo ${{ github.repository }} \
--target "${{ github.event.pull_request.merge_commit_sha }}" \
--title "${{ github.event.pull_request.title }}" \
--notes-file release-notes.md \
--notes "${{ github.event.pull_request.body }}" \
"amicons-${{ needs.build.outputs.version }}-icons.zip#Amicons icons v${{ needs.build.outputs.version }}"
env:
GH_TOKEN: ${{ github.token }}
- name: Publish to npm
run: npm publish ./amicons/studio384-amicons-${{ needs.build.outputs.version }}.tgz --access public --provenance --tag latest

deploy-docs:
name: Deploy to GitHub Pages
needs: [release, docs_check]
if: github.event.pull_request.base.ref == 'main' && contains(github.event.pull_request.labels.*.name, 'release') && github.event.pull_request.head.repo.full_name == github.repository
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: release-artifacts
- name: Set up pnpm
uses: pnpm/action-setup@v5
with:
version: 10.33.0
- name: Set up Node 24
uses: actions/setup-node@v6
with:
node-version: 24.x
cache: "pnpm"
cache-dependency-path: docs/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: docs/dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

prerelease:
name: Prerelease Amicons preview
needs: build
if: github.event.pull_request.base.ref == 'next' && github.event.pull_request.head.repo.full_name == github.repository
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'next' && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Download artifacts
Expand All @@ -174,18 +101,14 @@ jobs:
with:
node-version: 24.x
registry-url: "https://registry.npmjs.org"
- name: Write release notes
env:
BODY: ${{ github.event.pull_request.body }}
run: printf '%s' "$BODY" > release-notes.md
- name: Create GitHub prerelease
run: |
gh release create v${{ needs.build.outputs.version }} \
--repo ${{ github.repository }} \
--target "${{ github.event.pull_request.merge_commit_sha }}" \
--title "${{ github.event.pull_request.title }}" \
--notes "${{ github.event.pull_request.body }}" \
--prerelease \
--notes-file release-notes.md \
"amicons-${{ needs.build.outputs.version }}-icons.zip#Amicons icons v${{ needs.build.outputs.version }}"
env:
GH_TOKEN: ${{ github.token }}
Expand Down