1+ on :
2+ push :
3+ branches : [ master ]
4+ pull_request :
5+ branches : [ master ]
6+
7+ jobs :
8+ build :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v3
12+ - name : get-npm-version
13+ id : package-version
14+ uses : martinbeentjes/npm-get-version-action@main
15+
16+ - name : create-new-branch
17+ uses : stefanzweifel/git-auto-commit-action@v4
18+ with :
19+ commit_message : " New release: ${{ steps.package-version.outputs.current-version }}"
20+ branch : ${{ steps.package-version.outputs.current-version }}
21+ repository : .
22+
23+ - uses : actions/setup-node@v3
24+ with :
25+ node-version : 16
26+ - run : npm install
27+ - run : npm run format
28+ - run : npm run lint:fix
29+ - run : npm run build
30+
31+ # - run: git config advice.addIgnoredFile false
32+
33+ - run : rm .gitignore
34+ - uses : stefanzweifel/git-auto-commit-action@v4
35+ with :
36+ commit_options : ' --no-verify'
37+ commit_user_name : github-actions
38+ commit_user_email : noreply@arnaud.tech
39+ commit_author : github-actions <noreply@arnaud.tech>
40+ commit_message : " Remove .gitignore"
41+ skip_dirty_check : true
42+ push_options : ' --force'
43+ create_branch : true
44+ branch : ${{ steps.package-version.outputs.current-version }}
45+ file_pattern : ./.gitignore
46+
47+ - uses : stefanzweifel/git-auto-commit-action@v4
48+ with :
49+ commit_message : Updated build files
50+ commit_options : ' --no-verify'
51+ commit_user_name : github-actions
52+ commit_user_email : noreply@arnaud.tech
53+ commit_author : github-actions <noreply@arnaud.tech>
54+ file_pattern : ./index.min.js ./index.min.js.map ./package-lock.json
55+ skip_dirty_check : true
56+ push_options : ' --force'
57+ branch : ${{ steps.package-version.outputs.current-version }}
58+ create_branch : true
59+
60+ publish-github-release :
61+ needs : build
62+ runs-on : ubuntu-latest
63+ steps :
64+ - uses : actions/checkout@v3
65+ - name : get-npm-version
66+ id : package-version
67+ uses : martinbeentjes/npm-get-version-action@main
68+ - uses : actions/checkout@v3
69+ with :
70+ ref : ${{ steps.package-version.outputs.current-version }}
71+ - name : create-new-release
72+ uses : softprops/action-gh-release@v1
73+ with :
74+ files : |
75+ index.min.js
76+ index.min.js.map
77+ package-lock.json
78+ tag_name : ${{ steps.package-version.outputs.current-version }}
79+ name : ${{ steps.package-version.outputs.current-version }}
80+ body : |
81+ Release ${{ steps.package-version.outputs.current-version }}
82+ draft : false
83+ prerelease : false
84+ NODE_AUTH_TOKEN : ${{secrets.GITHUB_TOKEN}}
0 commit comments