-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (56 loc) · 1.99 KB
/
deploy-release.yml
File metadata and controls
69 lines (56 loc) · 1.99 KB
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
name: 'Deploy / Create Release'
on:
milestone:
types: [ closed ]
jobs:
release:
runs-on: ubuntu-latest
name: Create Release
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.repository.default_branch }}
- name: Setup the Git user
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Set version
run: |
echo "NEW_TAG_VERSION=${{ github.event.milestone.title }}" >> $GITHUB_ENV
- name: Validate tag version
run: |
MATCH='^([0-9]+\.){2}(\*|[0-9]+)(-.*)?$'
if ! [[ $NEW_TAG_VERSION =~ $MATCH ]]; then
echo "::error::Milestone title does not match semver format: '$NEW_TAG_VERSION'"
exit 1
fi
- name: Update changelog.txt
run: |
echo -e "${{ github.event.milestone.title }} / $(date +%Y-%m-%d)\n===================\n${{ github.event.milestone.description }}\n\n$(cat changelog.txt)" > changelog.txt
- name: Download the plugin-scan script from the submodule
run: |
git submodule update --init --recursive
- name: Run version update
run: |
npm --no-git-tag-version version $NEW_TAG_VERSION
npm run version
- name: Build Plugin Check
run: npm run build
- name: Publish new tag
run: |
git tag $NEW_TAG_VERSION
git push origin $NEW_TAG_VERSION
- name: Push changes
run: |
git add -A .
git commit -m "Updating to version $NEW_TAG_VERSION" --no-verify
git push
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create $NEW_TAG_VERSION -t "$NEW_TAG_VERSION"
- name: Upload asset to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload $NEW_TAG_VERSION build/plugin-check.zip