forked from paritytech/substrate
-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (41 loc) · 1.42 KB
/
monthly-tag.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
name: Monthly Snapshot Tag
on:
schedule:
- cron: "0 1 1 * *"
workflow_dispatch:
jobs:
build:
name: Take Snapshot
runs-on: ubuntu-latest
steps:
- name: Get the tags by date
id: tags
run: |
echo "::set-output name=new::$(date +'monthly-%Y-%m')"
echo "::set-output name=old::$(date -d'1 month ago' +'monthly-%Y-%m')"
- name: Checkout branch "master"
uses: actions/checkout@v3
with:
ref: 'master'
fetch-depth: 0
- name: Generate changelog
id: changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "# Automatic snapshot pre-release ${{ steps.tags.outputs.new }}" > Changelog.md
echo "" >> Changelog.md
echo "## Changes since last snapshot (${{ steps.tags.outputs.old }})" >> Changelog.md
echo "" >> Changelog.md
./scripts/ci/github/generate_changelog.sh ${{ steps.tags.outputs.old }} >> Changelog.md
- name: Release snapshot
id: release-snapshot
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4 latest version, repo archived
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tags.outputs.new }}
release_name: ${{ steps.tags.outputs.new }}
draft: false
prerelease: true
body_path: Changelog.md