-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (42 loc) · 1.36 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
name: Release
on:
workflow_run:
workflows: [Build Test Data]
branches: [main]
types: [completed]
permissions:
contents: write
actions: read
jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }} && ${{ github.ref == 'refs/heads/main' || github.event_name == 'schedule' }} && "!contains(github.event.head_commit.message, '[skip-build]')"
steps:
- name: Download Test Data
uses: dawidd6/action-download-artifact@v7
with:
name: test-data
workflow: build.yml
- name: Set some env variables
run: |
echo "RELEASE_DATE=$(date '+%D %T')" >> ${GITHUB_ENV}
echo "RELEASE_TAG=$(date '+%b.%d.%y.%H.%M.%S')" >> ${GITHUB_ENV}
- name: Create New Release
uses: softprops/action-gh-release@v2
with:
files: |
./test-data/*.json
name: ${{ env.RELEASE_DATE }}
tag_name: ${{ env.RELEASE_TAG }}
fail_on_unmatched_files: true
body: |
## Built on: ${{ env.RELEASE_DATE }}
body_path: ./results.md
- name: Remove old releases
uses: dev-drprasad/[email protected]
with:
keep_latest: 1
delete_tags: true
delete_expired_data: 7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}