Skip to content

Commit ea57de4

Browse files
authored
Merge pull request #18 from Studio384/1-alpha
Cleanup and simplification
2 parents 85d0b16 + 6645e07 commit ea57de4

2 files changed

Lines changed: 10 additions & 91 deletions

File tree

.github/workflows/documentation.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
name: Publish documentation
22

33
on:
4-
pull_request:
5-
types: [closed]
6-
branches: ["main", "next"]
4+
push:
5+
branches: ["main"]
76

87
permissions:
98
contents: write
109
id-token: write
1110
pages: write
1211

1312
concurrency:
14-
group: pages-${{ github.workflow }}-${{ github.ref }}
13+
group: documentation-${{ github.ref }}
1514
cancel-in-progress: true
1615

1716
jobs:
1817
build:
1918
name: Build Amicons package
20-
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')))
2119
runs-on: ubuntu-latest
2220
outputs:
2321
version: ${{ steps.version.outputs.version }}
@@ -60,7 +58,6 @@ jobs:
6058
6159
docs_check:
6260
name: Docs linting and formatting
63-
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
6461
runs-on: ubuntu-latest
6562
defaults:
6663
run:
@@ -87,8 +84,7 @@ jobs:
8784

8885
deploy-docs:
8986
name: Deploy to GitHub Pages
90-
needs: [docs_check]
91-
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
87+
needs: [build, docs_check]
9288
environment:
9389
name: github-pages
9490
url: ${{ steps.deployment.outputs.page_url }}

.github/workflows/release.yml

Lines changed: 6 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
pages: write
1212

1313
concurrency:
14-
group: pages-${{ github.workflow }}-${{ github.ref }}
14+
group: release-${{ github.ref }}
1515
cancel-in-progress: true
1616

1717
jobs:
@@ -58,37 +58,10 @@ jobs:
5858
amicons/studio384-amicons-*.tgz
5959
amicons-${{ steps.version.outputs.version }}-icons.zip
6060
61-
docs_check:
62-
name: Docs linting and formatting
63-
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
64-
runs-on: ubuntu-latest
65-
defaults:
66-
run:
67-
working-directory: docs
68-
steps:
69-
- name: Checkout
70-
uses: actions/checkout@v6
71-
- name: Set up pnpm
72-
uses: pnpm/action-setup@v5
73-
with:
74-
version: 10.33.0
75-
- name: Set up Node 24
76-
uses: actions/setup-node@v6
77-
with:
78-
node-version: 24.x
79-
cache: "pnpm"
80-
cache-dependency-path: docs/pnpm-lock.yaml
81-
- name: Install dependencies
82-
run: pnpm install --frozen-lockfile --ignore-scripts
83-
- name: Check formatting
84-
run: pnpm format
85-
- name: Lint
86-
run: pnpm lint
87-
8861
release:
8962
name: Release Amicons stable
90-
needs: [build, docs_check]
91-
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
63+
needs: build
64+
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
9265
runs-on: ubuntu-latest
9366
steps:
9467
- name: Download artifacts
@@ -100,69 +73,23 @@ jobs:
10073
with:
10174
node-version: 24.x
10275
registry-url: "https://registry.npmjs.org"
103-
- name: Write release notes
104-
env:
105-
BODY: ${{ github.event.pull_request.body }}
106-
run: printf '%s' "$BODY" > release-notes.md
10776
- name: Create GitHub release
10877
run: |
10978
gh release create v${{ needs.build.outputs.version }} \
11079
--repo ${{ github.repository }} \
11180
--target "${{ github.event.pull_request.merge_commit_sha }}" \
11281
--title "${{ github.event.pull_request.title }}" \
113-
--notes-file release-notes.md \
82+
--notes "${{ github.event.pull_request.body }}" \
11483
"amicons-${{ needs.build.outputs.version }}-icons.zip#Amicons icons v${{ needs.build.outputs.version }}"
11584
env:
11685
GH_TOKEN: ${{ github.token }}
11786
- name: Publish to npm
11887
run: npm publish ./amicons/studio384-amicons-${{ needs.build.outputs.version }}.tgz --access public --provenance --tag latest
11988

120-
deploy-docs:
121-
name: Deploy to GitHub Pages
122-
needs: [release, docs_check]
123-
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
124-
environment:
125-
name: github-pages
126-
url: ${{ steps.deployment.outputs.page_url }}
127-
runs-on: ubuntu-latest
128-
defaults:
129-
run:
130-
working-directory: docs
131-
steps:
132-
- name: Checkout
133-
uses: actions/checkout@v6
134-
- name: Download artifacts
135-
uses: actions/download-artifact@v8
136-
with:
137-
name: release-artifacts
138-
- name: Set up pnpm
139-
uses: pnpm/action-setup@v5
140-
with:
141-
version: 10.33.0
142-
- name: Set up Node 24
143-
uses: actions/setup-node@v6
144-
with:
145-
node-version: 24.x
146-
cache: "pnpm"
147-
cache-dependency-path: docs/pnpm-lock.yaml
148-
- name: Install dependencies
149-
run: pnpm install --frozen-lockfile
150-
- name: Build
151-
run: pnpm build
152-
- name: Setup Pages
153-
uses: actions/configure-pages@v5
154-
- name: Upload artifact
155-
uses: actions/upload-pages-artifact@v4
156-
with:
157-
path: docs/dist
158-
- name: Deploy to GitHub Pages
159-
id: deployment
160-
uses: actions/deploy-pages@v4
161-
16289
prerelease:
16390
name: Prerelease Amicons preview
16491
needs: build
165-
if: github.event.pull_request.base.ref == 'next' && github.event.pull_request.head.repo.full_name == github.repository
92+
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'next' && github.event.pull_request.head.repo.full_name == github.repository
16693
runs-on: ubuntu-latest
16794
steps:
16895
- name: Download artifacts
@@ -174,18 +101,14 @@ jobs:
174101
with:
175102
node-version: 24.x
176103
registry-url: "https://registry.npmjs.org"
177-
- name: Write release notes
178-
env:
179-
BODY: ${{ github.event.pull_request.body }}
180-
run: printf '%s' "$BODY" > release-notes.md
181104
- name: Create GitHub prerelease
182105
run: |
183106
gh release create v${{ needs.build.outputs.version }} \
184107
--repo ${{ github.repository }} \
185108
--target "${{ github.event.pull_request.merge_commit_sha }}" \
186109
--title "${{ github.event.pull_request.title }}" \
110+
--notes "${{ github.event.pull_request.body }}" \
187111
--prerelease \
188-
--notes-file release-notes.md \
189112
"amicons-${{ needs.build.outputs.version }}-icons.zip#Amicons icons v${{ needs.build.outputs.version }}"
190113
env:
191114
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)