Skip to content

.github/workflows/monthly.yml #30

.github/workflows/monthly.yml

.github/workflows/monthly.yml #30

Workflow file for this run

on:
workflow_dispatch:
schedule:
# 3:25 UTC (12:25 JST) on 1st day of every month
- cron: '25 3 1 * *'
- cron: '25 3 2/1 * *'
jobs:
archive:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: source
- run: |
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
export USER_AGENT='Mozilla/5.0 (compatible; elaws-history/2.0.0; +https://github.com/kissge/elaws-history)'
bash run.sh
release:
runs-on: ubuntu-latest
if: github.event.schedule == '25 3 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