-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (39 loc) · 1.33 KB
/
monthly.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
on:
workflow_dispatch:
schedule:
# 14:25 UTC (23:25 JST)
- cron: '25 14 1 * *'
- cron: '25 14 2/1 * *'
jobs:
archive:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: source
fetch-tags: true
- run: bash run.sh
env:
GIT_REMOTE_URL: https://github-actions:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
release:
runs-on: ubuntu-latest
if: github.event.schedule == '25 14 1 * *'
needs: archive
steps:
- name: Get Info
id: get-info
run: |
set -Eeuo pipefail
# Get current date
echo ::set-output name=name::$(TZ=Asia/Tokyo date +%Y%m%d)
# Get latest tag (without fetch/clone, thus a bit hacky)
echo ::set-output name=tag_name::$(git ls-remote --tags --refs --sort='-version:refname' --exit-code \
"${{ github.server_url }}/${{ github.repository }}" \
'*T*.*' | \
sed -ne '1s@.*refs/tags/@@p')
- uses: softprops/action-gh-release@v1
with:
name: ${{ steps.get-info.outputs.name }}
tag_name: ${{ steps.get-info.outputs.tag_name }}
permissions:
contents: write