-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (68 loc) · 2.43 KB
/
tld-resolver-keys-sync.yaml
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
# Workflow to sync the latest TLDs and resolver keys
name: TLDs Resolver Keys Sync
on:
schedule:
- cron: '00 12 * * 1' # At 01:00 on Mondays.
workflow_dispatch:
inputs:
confirm:
description: 'It will check and release a new npm package version if there are new TLDs and resolver keys.
Do you want to continue?'
default: false
type: boolean
required: true
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
token: ${{ secrets.RELEASE_SECRET }}
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
always-auth: true
registry-url: "https://registry.npmjs.org"
- name: Install Dependencies
run: npm install
- name: Run sync script
id: sync-script
run: npm run sync
- name: Get Previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Get next minor version
id: semvers
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: New package.json version
if: steps.sync-script.outputs.publish == 'true'
run: npm version --new-version ${{ steps.semvers.outputs.patch }} --no-git-tag-version
- name: Create git tag
if: steps.sync-script.outputs.publish == 'true'
run: |
git tag ${{ steps.semvers.outputs.patch }}
git push origin --tags
- name: Update Changelog
if: steps.sync-script.outputs.publish == 'true'
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ steps.semvers.outputs.patch }}
release-notes: ${{ steps.sync-script.outputs.changeLog }}
- name: Commit new version
if: steps.sync-script.outputs.publish == 'true'
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ github.event.release.target_commitish }}
commit_message: Release new version ${{ steps.semvers.outputs.patch }}
- run:
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
- name: Publish
if: steps.sync-script.outputs.publish == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: npm publish