-
-
Notifications
You must be signed in to change notification settings - Fork 8k
154 lines (129 loc) · 5.65 KB
/
Copy pathci.yml
File metadata and controls
154 lines (129 loc) · 5.65 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: GitHub Actions Build and Deploy awesome-mac
on:
push:
branches:
- master
jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 50
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run build
- run: npm run create:ast
- run: npm run feed
- name: Commit updated RSS feeds
run: |
if git diff --quiet -- feed/*.xml; then
echo "No RSS feed changes to commit."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add feed/*.xml
git commit \
-m "chore: update RSS feeds [skip ci]" \
-m "Refresh generated RSS feeds for recently added high-quality macOS apps." \
-m "Feeds:
https://jaywcjlove.github.io/awesome-mac/feed.xml
https://jaywcjlove.github.io/awesome-mac/feed-zh.xml
https://jaywcjlove.github.io/awesome-mac/feed-ko.xml
https://jaywcjlove.github.io/awesome-mac/feed-ja.xml"
git push
- run: cp -rp feed/*.xml dist
- name: Deploy
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
user_name: github-actions[bot]
user_email: github-actions[bot]@users.noreply.github.com
- name: Create Tag
id: create_tag
uses: jaywcjlove/create-tag-action@5cd7624be00f5ca9f6c0929957553205dd035864 # main
with:
package-path: ./package.json
- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@8e2e0cff25d4500fb7cc4c7c87f0733b8f80ff5b # main
with:
token: ${{ secrets.GITHUB_TOKEN }}
head-ref: ${{steps.create_tag.outputs.version}}
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
- name: Create Release
uses: jaywcjlove/create-tag-action@5cd7624be00f5ca9f6c0929957553205dd035864 # main
if: steps.create_tag.outputs.successful
with:
package-path: ./package.json
version: ${{steps.create_tag.outputs.version}}
release: true
prerelease: false
draft: false
body: |
[](https://jaywcjlove.github.io/#/sponsor) [](https://uiwjs.github.io/npm-unpkg/#/pkg/awesome-mac@${{steps.create_tag.outputs.versionNumber}}/file/README.md) [](https://hub.docker.com/r/wcjiang/awesome-mac)
Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/jaywcjlove/awesome-mac/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
```bash
npm i awesome-mac@${{steps.create_tag.outputs.versionNumber}}
# dist/awesome-mac.json
# dist/awesome-mac.zh.json
# dist/awesome-mac.ja.json
# dist/awesome-mac.ko.json
```
## Feed
```text
https://jaywcjlove.github.io/awesome-mac/feed.xml
https://jaywcjlove.github.io/awesome-mac/feed-zh.xml
https://jaywcjlove.github.io/awesome-mac/feed-ko.xml
https://jaywcjlove.github.io/awesome-mac/feed-ja.xml
```
## Docker
```bash
docker pull wcjiang/awesome-mac:${{steps.changelog.outputs.version}}
```
```bash
docker run --name awesome-mac --rm -d -p 9881:3000 wcjiang/awesome-mac:${{steps.changelog.outputs.version}}
# Or
docker run --name awesome-mac -itd -p 9881:3000 wcjiang/awesome-mac:${{steps.changelog.outputs.version}}
```
Visit the following URL in your browser
```bash
http://localhost:9881/
```
- run: npm publish --access public --provenance
continue-on-error: true
# Create Docker Image
- name: Docker login
if: steps.create_tag.outputs.successful
run: docker login -u "${DOCKER_USER}" -p "${DOCKER_PASSWORD}"
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Awesome Mac image
run: docker image build -t awesome-mac .
- name: Tags & Push image (latest)
if: steps.create_tag.outputs.successful
run: |
echo "outputs.tag - ${{ steps.changelog.outputs.version }}"
docker tag awesome-mac "${DOCKER_USER}"/awesome-mac:latest
docker push "${DOCKER_USER}"/awesome-mac:latest
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
- name: Tags & Push image
if: steps.create_tag.outputs.successful
run: |
echo "outputs.tag - ${{ steps.changelog.outputs.version }}"
docker tag awesome-mac "${DOCKER_USER}"/awesome-mac:${{steps.changelog.outputs.version}}
docker push "${DOCKER_USER}"/awesome-mac:${{steps.changelog.outputs.version}}
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}