From 34a625f55abb6ec9738a773b61b13bb3fcb0af4a Mon Sep 17 00:00:00 2001 From: Hiroyuki Yamada Date: Thu, 18 Jan 2024 10:31:49 +0900 Subject: [PATCH] Update the timestamp --- .github/pull_request_template.md | 27 +++++++++++++++ .github/workflows/generate-timestamp.yaml | 42 +++++++++++++++++++++++ timestamp.json | 1 + 3 files changed, 70 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/generate-timestamp.yaml create mode 100644 timestamp.json diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..d8faf25 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,27 @@ +## Description + +> Provide a brief description about **why** this PR is necessary. Be sure to provide context. + +## Related issues and/or PRs + +> If this PR addresses or references any issues and/or other PRs, list them here. + +## Changes made + +> Outline the specific changes made in this pull request. Include relevant details, such as added features, bug fixes, code refactoring, or improvements. + +## Checklist + +> The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item. + +- [ ] I have commented my code, particularly in hard-to-understand areas. +- [ ] I have updated the documentation to reflect the changes. +- [ ] Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.). +- [ ] Tests (unit, integration, etc.) have been added for the changes. +- [ ] My changes generate no new warnings. +- [ ] Any dependent changes in other PRs have been merged and published. + +## Additional notes (optional) + +> Provide any additional information or notes that may be relevant to the reviewers or stakeholders. + diff --git a/.github/workflows/generate-timestamp.yaml b/.github/workflows/generate-timestamp.yaml new file mode 100644 index 0000000..1ac4a31 --- /dev/null +++ b/.github/workflows/generate-timestamp.yaml @@ -0,0 +1,42 @@ +name: Generate a signed timestamp + +on: + workflow_dispatch: + schedule: + - cron: '0 */6 * * *' + +jobs: + generate-timestamp: + runs-on: ubuntu-latest + + steps: + - name: Checkout scalar-licensing repo + uses: actions/checkout@v3 + with: + repository: scalar-labs/scalar-licensing + token: ${{ secrets.GH_PAT }} + + - name: Setup and execute Gradle 'installDist' task + uses: gradle/gradle-build-action@v2 + with: + arguments: installDist + + - name: Generate a signed timestamp + run: | + echo "${{ secrets.TRIAL_SIGNING_PRIVATE_KEY_PEM }}" > $HOME/private-key.pem + lib/build/install/lib/bin/generate-signed-timestamp --private-key-file=$HOME/private-key.pem > $HOME/timestamp.json + + - name: Checkout this repo + uses: actions/checkout@v3 + with: + token: ${{ secrets.GH_PAT }} + + - name: Commit the timestamp + run: | + cp $HOME/timestamp.json . + git config user.name github-actions + git config user.email action@github.com + git add . + git commit --amend -m "Update the timestamp" + git push -f + diff --git a/timestamp.json b/timestamp.json new file mode 100644 index 0000000..ce849bb --- /dev/null +++ b/timestamp.json @@ -0,0 +1 @@ +{"date_time":"2024-12-02T21:01:00.591577+09:00[Asia/Tokyo]","signature":"MEUCIFnWocV4NvaKGeIUORn9GxC/ihcDNV2myCEGUA3kRJ//AiEAvWXo+6+SpvLUHG+zQSYr7bnq8396zDd/+1FBsphL16o="}