forked from dotnet/AspNetCore.Docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turn on GitHub action for whatsnew (dotnet#22616)
- Add shell script, yml config and package for "what's new" package - add the NuGet package with the latest tool - Update the whatsnew.json file to include parameters for automatically updated the index.yml and toc.yml - Update the TOC so that it has a single rolling list of articles (the action expects that)
- Loading branch information
1 parent
6aa1002
commit 0d998fa
Showing
5 changed files
with
116 additions
and
19 deletions.
There are no files selected for viewing
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# This script runs the .NET CLI, invoking the what's new global tool | ||
# $1 is the <github.repository_owner> | ||
# $2 is the <github.repository> | ||
# $3 is the savedir | ||
|
||
declare -r STARTDATE=$(date "+%F" -d "$(date +'%Y-%m-01') -1 month"); | ||
declare -r ENDDATE=$(date "+%F" -d "$STARTDATE +1 month -1 day"); | ||
|
||
echo "From $STARTDATE to $ENDDATE" | ||
|
||
while getopts o:r:s: option | ||
do | ||
case "${option}" | ||
in | ||
o) OWNER=${OPTARG};; | ||
r) REPO=${OPTARG};; | ||
s) SAVEDIR=${OPTARG};; | ||
esac | ||
done | ||
|
||
dotnet whatsnew \ | ||
--owner $OWNER \ | ||
--repo $REPO \ | ||
--startdate $STARTDATE \ | ||
--enddate $ENDDATE \ | ||
--savedir $SAVEDIR |
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: 'generate what''s new article' | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the default branch | ||
schedule: | ||
- cron: '0 0 1 * *' # The first of every month | ||
workflow_dispatch: | ||
inputs: | ||
reason: | ||
description: 'The reason for running the workflow' | ||
required: true | ||
default: 'Manual run' | ||
|
||
env: | ||
DOTNET_VERSION: '5.0.301' # set this to the dot net version to use | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "create-what-is-new" | ||
create-what-is-new: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
# Runs a single command using the runners shell | ||
- name: 'Print manual run reason' | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
run: | | ||
echo 'Reason: ${{ github.event.inputs.reason }}' | ||
# Print dotnet info | ||
- name: Display .NET info | ||
run: dotnet --info | ||
|
||
# Install dotnet-whatsnew global tool | ||
- name: Install dotnet-whatsnew tool | ||
run: | | ||
dotnet tool install --global --add-source ./.github/workflows/dependencies/ dotnet-whatsnew | ||
# Run dotnet-whatsnew tool | ||
- name: Generate what's new | ||
id: dotnet-whatsnew | ||
env: | ||
GitHubKey: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
./.github/workflows/dependencies/run-dotnet-whatsnew.sh -o dotnet -r AspNetCore.Docs -s './aspnetcore/whats-new' | ||
# Create the PR for the new article | ||
- name: create-pull-request | ||
uses: peter-evans/[email protected] | ||
with: | ||
title: 'What''s new article' | ||
commit-message: 'Bot 🤖 generated "What''s new article"' | ||
body: 'Automated creation of What''s new article.' |
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
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,23 +1,17 @@ | ||
items: | ||
- name: What's new | ||
href: index.yml | ||
expanded: true | ||
items: | ||
- name: 2021 | ||
expanded: true | ||
items: | ||
- name: May | ||
href: 2021-05.md | ||
- name: April | ||
href: 2021-04-01.md | ||
- name: March | ||
href: 2021-03.md | ||
- name: February | ||
href: 2021-02.md | ||
- name: January | ||
href: 2021-01.md | ||
- name: 2020 | ||
expanded: true | ||
items: | ||
- name: December | ||
href: 2020-12.md | ||
|
||
- name: May 2021 | ||
href: 2021-05.md | ||
- name: April 2021 | ||
href: 2021-04-01.md | ||
- name: March 2021 | ||
href: 2021-03.md | ||
- name: February 2021 | ||
href: 2021-02.md | ||
- name: January 2021 | ||
href: 2021-01.md | ||
- name: December 2021 | ||
href: 2020-12.md |