Add a TagBot plugin

This commit is contained in:
Chris de Graaf 2019-11-02 20:16:47 +07:00
parent a41187be1c
commit a79c087010
No known key found for this signature in database
GPG Key ID: 150FFDD9B0073C7B
14 changed files with 115 additions and 1 deletions

12
.github/workflows/TagBot.yml vendored Normal file
View File

@ -0,0 +1,12 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -40,6 +40,7 @@ Tests
Readme
License
Git
TagBot
```
### Continuous Integration (CI)

View File

@ -28,6 +28,7 @@ export
ProjectFile,
Readme,
SrcDir,
TagBot,
Tests,
TravisCI

View File

@ -257,6 +257,7 @@ include(joinpath("plugins", "tests.jl"))
include(joinpath("plugins", "readme.jl"))
include(joinpath("plugins", "license.jl"))
include(joinpath("plugins", "git.jl"))
include(joinpath("plugins", "tagbot.jl"))
include(joinpath("plugins", "develop.jl"))
include(joinpath("plugins", "coverage.jl"))
include(joinpath("plugins", "ci.jl"))

19
src/plugins/tagbot.jl Normal file
View File

@ -0,0 +1,19 @@
"""
TagBot(; destination="TagBot.yml", gpgsign=false)
Adds GitHub release support via [TagBot](https://github.com/JuliaRegistries/TagBot).
## Keyword Arguments
- `destination::AbstractString`: Destination of the worflow file,
relative to `.github/workflows`.
- `gpgsign::Bool`: Whether or not to enable GPG signing of tags.
"""
@with_kw_noshow struct TagBot <: BasicPlugin
destination::String = "TagBot.yml"
gpgsign::Bool = false
end
source(::TagBot) = default_file("github", "workflows", "TagBot.yml")
destination(p::TagBot) = joinpath(".github", "workflows", p.destination)
tags(::TagBot) = "<<", ">>"
view(p::TagBot, ::Template, ::AbstractString) = Dict("HAS_GPG" => p.gpgsign)

View File

@ -1,4 +1,4 @@
default_plugins() = [ProjectFile(), SrcDir(), Git(), License(), Readme(), Tests()]
default_plugins() = [ProjectFile(), SrcDir(), Git(), License(), Readme(), Tests(), TagBot()]
default_user() = LibGit2.getconfig("github.user", "")
default_version() = VersionNumber(VERSION.major)

View File

@ -0,0 +1,15 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
<<#HAS_GPG>>
gpg-key: ${{ secrets.GPG_KEY }}
<</HAS_GPG>>

View File

@ -0,0 +1,12 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -0,0 +1,12 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -0,0 +1,12 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -0,0 +1,12 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -0,0 +1,13 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
gpg-key: ${{ secrets.GPG_KEY }}

View File

@ -76,6 +76,7 @@ end
License(; name="ISC"),
ProjectFile(; version=v"1"),
Readme(; inline_badges=true),
TagBot(; gpgsign=true),
Tests(; project=true),
TravisCI(;
coverage=false,

View File

@ -46,6 +46,9 @@ const LICENSES_DIR = joinpath(TEMPLATES_DIR, "licenses")
inline_badges: false
SrcDir:
file: "$(joinpath(TEMPLATES_DIR, "src", "module.jl"))"
TagBot:
destination: "TagBot.yml"
gpgsign: false
Tests:
file: "$(joinpath(TEMPLATES_DIR, "test", "runtests.jl"))"
project: false