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 build
28+
29+ # - run: git config advice.addIgnoredFile false
30+
31+ - run : rm .gitignore
32+ - uses : stefanzweifel/git-auto-commit-action@v4
33+ with :
34+ commit_options : ' --no-verify'
35+ commit_user_name : github-actions
36+ commit_user_email : noreply@arnaud.tech
37+ commit_author : github-actions <noreply@arnaud.tech>
38+ commit_message : " Remove .gitignore"
39+ skip_dirty_check : true
40+ push_options : ' --force'
41+ create_branch : true
42+ branch : ${{ steps.package-version.outputs.current-version }}
43+ file_pattern : ./.gitignore
44+
45+ - uses : stefanzweifel/git-auto-commit-action@v4
46+ with :
47+ commit_message : Updated build files
48+ commit_options : ' --no-verify'
49+ commit_user_name : github-actions
50+ commit_user_email : noreply@arnaud.tech
51+ commit_author : github-actions <noreply@arnaud.tech>
52+ file_pattern : |
53+ build/index.min.js
54+ # build/index.min.js.map
55+ package-lock.json
56+ skip_dirty_check : true
57+ push_options : ' --force'
58+ branch : ${{ steps.package-version.outputs.current-version }}
59+ create_branch : true
60+
61+ publish-github-release :
62+ needs : build
63+ runs-on : ubuntu-latest
64+ steps :
65+ - uses : actions/checkout@v3
66+ - name : get-npm-version
67+ id : package-version
68+ uses : martinbeentjes/npm-get-version-action@main
69+ - uses : actions/checkout@v3
70+ with :
71+ ref : ${{ steps.package-version.outputs.current-version }}
72+ - name : create-new-release
73+ uses : softprops/action-gh-release@v1
74+ with :
75+ files : |
76+ build/index.min.js
77+ # build/index.min.js.map
78+ package-lock.json
79+ tag_name : ${{ steps.package-version.outputs.current-version }}
80+ name : ${{ steps.package-version.outputs.current-version }}
81+ body : |
82+ Release ${{ steps.package-version.outputs.current-version }}
83+ draft : false
84+ prerelease : false
85+ NODE_AUTH_TOKEN : ${{secrets.GITHUB_TOKEN}}
0 commit comments