generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.63 KB
/
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
name: Release new version
on:
workflow_dispatch:
inputs:
level:
description: 'Semantic level bump'
required: true
default: 'minor'
type: choice
options:
- major
- minor
- patch
jobs:
bump:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.MILES_BOT_TOKEN }}
# In order to make a commit, we need to initialize a user.
# You may choose to write something less generic here if you want, it doesn't matter functionality wise.
- name: Initialize mandatory git config
run: |
git config user.name "Miles Bot"
git config user.email "[email protected]"
- name: Bump version
id: bump-version
run: echo "version=$(npm version ${{ inputs.level }} --tag-version-prefix=)" >> $GITHUB_OUTPUT
- name: Build assets
run: |
npm install
npm run prod
git add -A public
# Make sure that the Miles Bot user is included in the list of users who can bypass required pull request requirement
# Your repo -> Settings -> Branches -> Main (edit) -> "Allow specified actors to bypass required pull requests"
- name: Push changes
run: git push origin main
- name: Push tag
run: git push origin ${{ steps.bump-version.outputs.version }}
- name: Create new release
run: gh release create ${{ steps.bump-version.outputs.version }} --generate-notes --latest
env:
GITHUB_TOKEN: ${{ secrets.MILES_BOT_TOKEN }}