-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update zenodo.yml release action (not using deprecated sub-actions or…
… old nodejs)
- Loading branch information
1 parent
0684873
commit d341923
Showing
1 changed file
with
25 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,36 @@ | ||
name: Make release | ||
name: Automated Zenodo release | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * 0' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Get time | ||
id: time | ||
uses: nanzm/[email protected] | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set release date | ||
id: date | ||
run: | | ||
echo "RELEASE_DATE=$(date '+%Y-%m-%d-%H-%M-%S')" >> $GITHUB_ENV | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: actions/github-script@v7 | ||
with: | ||
tag_name: ${{ steps.time.outputs.time }} | ||
release_name: Release ${{ steps.time.outputs.time }} | ||
body: | | ||
Automated release bot to push zenodo | ||
draft: false | ||
prerelease: false | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const release = await github.rest.repos.createRelease({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
tag_name: process.env.RELEASE_DATE, | ||
name: `Release ${process.env.RELEASE_DATE}`, | ||
body: 'Automated release bot to push zenodo', | ||
draft: false, | ||
prerelease: false | ||
}); | ||
console.log(`Release created successfully: ${release.data.html_url}`); |