forked from fumizo07/zofumi02
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 1.42 KB
/
auto-generate.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
name: Auto-generate scripts
on:
push:
branches: [ main ]
paths:
- "generate/**"
- ".github/workflows/**"
schedule:
- cron: "0 9 * * FRI"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.17
- name: "Run generator tests"
shell: bash
run: |
sudo bash ./test.sh 2>&1
working-directory: generate
- name: "Run regeneration script"
shell: bash
run: |
sudo bash ./generate-all.sh 2>&1
working-directory: generate
- name: Generate tag name
run: echo "TAG_NAME=$(date +%F-%H-%M)" >> $GITHUB_ENV
- name: Release scripts
uses: softprops/action-gh-release@v1
with:
files: block/*.user.js
name: Automatic script generation
tag_name: ${{ env.TAG_NAME }}
body: "This release contains all scripts provided by this repository.\n\nPlease see [the main project page](${{ github.server_url }}/${{ github.repository }}) for a description of the scripts."
body_path: generate/release/release.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete older releases
uses: dev-drprasad/[email protected]
with:
keep_latest: 2
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}