-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (110 loc) · 4.38 KB
/
Copy pathrelease.yml
File metadata and controls
116 lines (110 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Release Amicons update
on:
pull_request:
types: [closed]
branches: ["main", "next"]
permissions:
contents: write
id-token: write
pages: write
concurrency:
group: release-${{ 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, 'release')))
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Get version
id: version
run: echo "version=$(jq -r '.version' amicons/package.json)" >> $GITHUB_OUTPUT
- 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: amicons/pnpm-lock.yaml
- name: Install dependencies
working-directory: amicons
run: pnpm install --frozen-lockfile
- name: Production build
working-directory: amicons
run: pnpm prod
- name: Pack for npm
working-directory: amicons
run: pnpm pack
- name: Package icons
working-directory: amicons/icons
run: zip -r ../../amicons-${{ steps.version.outputs.version }}-icons.zip . -i "*.svg"
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: release-artifacts
path: |
amicons/dist
amicons/studio384-amicons-*.tgz
amicons-${{ steps.version.outputs.version }}-icons.zip
release:
name: Release Amicons stable
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
uses: actions/download-artifact@v8
with:
name: release-artifacts
- name: Set up Node 24
uses: actions/setup-node@v6
with:
node-version: 24.x
registry-url: "https://registry.npmjs.org"
- 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 "${{ 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
prerelease:
name: Prerelease Amicons preview
needs: build
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
uses: actions/download-artifact@v8
with:
name: release-artifacts
- name: Set up Node 24
uses: actions/setup-node@v6
with:
node-version: 24.x
registry-url: "https://registry.npmjs.org"
- 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 \
"amicons-${{ needs.build.outputs.version }}-icons.zip#Amicons icons v${{ needs.build.outputs.version }}"
env:
GH_TOKEN: ${{ github.token }}
- name: Publish to npm (next)
run: npm publish ./amicons/studio384-amicons-${{ needs.build.outputs.version }}.tgz --access public --provenance --tag next