mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-31 16:09:47 +00:00
Add a workflow file to update the nightly version every month (#118)
Part of https://github.com/serai-dex/serai/issues/116
This commit is contained in:
parent
2393cdfe8c
commit
a52b2e2148
2 changed files with 58 additions and 1 deletions
2
.github/nightly-version
vendored
2
.github/nightly-version
vendored
|
@ -1 +1 @@
|
|||
nightly-2022-09-01
|
||||
nightly-2022-08-01
|
||||
|
|
57
.github/workflows/monthly-nightly-update.yml
vendored
Normal file
57
.github/workflows/monthly-nightly-update.yml
vendored
Normal file
|
@ -0,0 +1,57 @@
|
|||
name: Monthly Nightly Update
|
||||
|
||||
on:
|
||||
push:
|
||||
schedule:
|
||||
- cron: "0 0 1 * *"
|
||||
|
||||
jobs:
|
||||
update:
|
||||
name: Update nightly
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: "recursive"
|
||||
|
||||
- name: Write nightly version
|
||||
run: echo $(date +"nightly-%Y-%m"-01) > .github/nightly-version
|
||||
|
||||
- name: Create the commit
|
||||
id: commit
|
||||
run: |
|
||||
git config user.name "GitHub Actions"
|
||||
git config user.email "<>"
|
||||
|
||||
git checkout -b $(date +"nightly-%Y-%m")
|
||||
|
||||
git add .github/nightly-version
|
||||
git commit -m "Update nightly"
|
||||
git push -u origin $(date +"nightly-%Y-%m")
|
||||
|
||||
echo "::set-output name=commit::$(git rev-parse HEAD)"
|
||||
|
||||
- name: Pull Request
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const { repo, owner } = context.repo;
|
||||
|
||||
const result = await github.rest.pulls.create({
|
||||
title: (new Date()).toLocaleString(
|
||||
false,
|
||||
{ month: "long", year: "numeric" }
|
||||
) + " - Rust Nightly Update",
|
||||
owner,
|
||||
repo,
|
||||
head: "${{ steps.commit.outputs.commit }}",
|
||||
base: "develop",
|
||||
body: "PR auto-generated by a GitHub workflow."
|
||||
});
|
||||
|
||||
github.rest.issues.addLabels({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: result.data.number,
|
||||
labels: ["improvement"]
|
||||
});
|
Loading…
Reference in a new issue