-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (74 loc) · 2.38 KB
/
create-release.yml
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
name: Build Release
on:
push:
tags:
- '*'
# - '/^\d+\.\d+\.\d+(-\w+)?$/'
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
node-version: [ 20.x ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Fixup git permissions
# https://github.com/actions/checkout/issues/766
shell: bash
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Build Project
run: |
npm install
npm run build:prod
- name: Clean package
run: |
rm -rf .git .github node_modules .gitignore
- name: Get current date
id: date
run: |
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "datestamp=$(date +'%s')" >> $GITHUB_OUTPUT
- name: Versioning
uses: "DamianReeves/write-file-action@master"
with:
path: skenografia.info.yml
write-mode: append
contents: |
# Information added by Github Action packaging script on ${{ steps.date.outputs.date }}
version: '${{ github.ref_name }}'
project: 'skenografia'
datestamp: ${{ steps.date.outputs.datestamp }}
- name: Compress Dist Folder
run: zip -r skenografia.zip ./dist
- name: Set Package Version
run: |
npm version ${{ github.ref_name }}
- name: NPM registry
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm config set registry https://registry.npmjs.org/
- name: Publish package to NPM
run: npm publish --access=public
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: rm ~/.npmrc
- name: Create Package dist
id: create_release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifactErrorsFailBuild: true
artifacts: skenografia.zip