Archived
55 lines
1.6 KiB
YAML
55 lines
1.6 KiB
YAML
name: Auto release
|
|
|
|
on:
|
|
schedule:
|
|
# Second Sunday of every month at 00:00 UTC
|
|
- cron: "0 0 8-14 * 0"
|
|
workflow_dispatch: {}
|
|
|
|
env:
|
|
GIT_EMAIL: noreply@cryptic.systems
|
|
GIT_USER: CSRBot
|
|
|
|
jobs:
|
|
create_tag_and_release:
|
|
permissions:
|
|
actions: write
|
|
contents: write
|
|
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Create and push new tag
|
|
id: create_tag
|
|
run: |
|
|
defined_tag="$(date -u +"%Y%m%d%H%M%S").${{ github.run_id }}"
|
|
|
|
echo "defined_tag=${defined_tag}" >> $GITHUB_OUTPUT
|
|
echo "New tag: ${defined_tag}"
|
|
|
|
git config --local user.name "${GIT_USER}"
|
|
git config --local user.email "${GIT_EMAIL}"
|
|
git tag -a "${defined_tag}" -m "${defined_tag}"
|
|
git push origin "${defined_tag}"
|
|
|
|
- name: Trigger "Release" workflow
|
|
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
|
|
with:
|
|
script: |
|
|
const workflowFileName = 'release.yaml';
|
|
const defaultBranch = context.payload.repository.default_branch;
|
|
const definedTag = '${{ steps.create_tag.outputs.defined_tag }}';
|
|
|
|
await github.rest.actions.createWorkflowDispatch({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
workflow_id: workflowFileName,
|
|
ref: defaultBranch,
|
|
inputs: {
|
|
tag: definedTag
|
|
}
|
|
});
|