Rework TagBot to fit the new options
This commit is contained in:
parent
7c5552202c
commit
428ab6966f
@ -1,42 +1,25 @@
|
|||||||
"""
|
"""
|
||||||
TagBot(;
|
TagBot(; destination="TagBot.yml", registry=nothing, dispatch=false)
|
||||||
destination="TagBot.yml",
|
|
||||||
gpgsign=false,
|
|
||||||
registry=nothing,
|
|
||||||
github_site=nothing,
|
|
||||||
github_api=nothing,
|
|
||||||
)
|
|
||||||
|
|
||||||
Adds GitHub release support via [TagBot](https://github.com/JuliaRegistries/TagBot).
|
Adds GitHub release support via [TagBot](https://github.com/JuliaRegistries/TagBot).
|
||||||
|
|
||||||
## Keyword Arguments
|
## Keyword Arguments
|
||||||
- `destination::AbstractString`: Destination of the worflow file,
|
- `destination::AbstractString`: Destination of the worflow file,
|
||||||
relative to `.github/workflows`.
|
relative to `.github/workflows`.
|
||||||
- `gpgsign::Bool`: Whether or not to enable GPG signing of tags.
|
|
||||||
- `registry::Union{AbstractString, Nothing}`: Custom registry, in the format `owner/repo`.
|
- `registry::Union{AbstractString, Nothing}`: Custom registry, in the format `owner/repo`.
|
||||||
- `github_site::Union{AbstractString, Nothing}`: URL to a self-hosted GitHub instance.
|
- `dispatch::Bool`: Whether or not to enable the `dispatch` option.
|
||||||
- `github_api::Union{AbstractString, Nothing}`: URL to a self-hosted GitHub instance's API.
|
|
||||||
|
|
||||||
!!! note
|
|
||||||
If you set `gpgsign`, you must add the `GPG_KEY` secret to your repository yourself.
|
|
||||||
"""
|
"""
|
||||||
@with_kw_noshow struct TagBot <: BasicPlugin
|
@with_kw_noshow struct TagBot <: BasicPlugin
|
||||||
destination::String = "TagBot.yml"
|
destination::String = "TagBot.yml"
|
||||||
gpgsign::Bool = false
|
|
||||||
registry::Union{String, Nothing} = nothing
|
registry::Union{String, Nothing} = nothing
|
||||||
github_api::Union{String, Nothing} = nothing
|
dispatch::Bool = false
|
||||||
github_site::Union{String, Nothing} = nothing
|
|
||||||
end
|
end
|
||||||
|
|
||||||
source(::TagBot) = default_file("github", "workflows", "TagBot.yml")
|
source(::TagBot) = default_file("github", "workflows", "TagBot.yml")
|
||||||
destination(p::TagBot) = joinpath(".github", "workflows", p.destination)
|
destination(p::TagBot) = joinpath(".github", "workflows", p.destination)
|
||||||
tags(::TagBot) = "<<", ">>"
|
tags(::TagBot) = "<<", ">>"
|
||||||
|
|
||||||
function view(p::TagBot, ::Template, ::AbstractString)
|
view(p::TagBot, ::Template, ::AbstractString) = Dict(
|
||||||
return Dict(
|
"HAS_DISPATCH" => p.dispatch,
|
||||||
"GITHUB_API" => p.github_api,
|
"REGISTRY" => p.registry,
|
||||||
"GITHUB_SITE" => p.github_site,
|
)
|
||||||
"HAS_GPG" => p.gpgsign,
|
|
||||||
"REGISTRY" => p.registry,
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
@ -6,19 +6,12 @@ jobs:
|
|||||||
TagBot:
|
TagBot:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- uses: JuliaRegistries/TagBot@v1
|
- uses: JuliaRegistries/TagBot@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
<<#HAS_GPG>>
|
|
||||||
gpg-key: ${{ secrets.GPG_KEY }}
|
|
||||||
<</HAS_GPG>>
|
|
||||||
<<#REGISTRY>>
|
<<#REGISTRY>>
|
||||||
registry: <<®ISTRY>>
|
registry: <<®ISTRY>>
|
||||||
<</REGISTRY>>
|
<</REGISTRY>>
|
||||||
<<#GITHUB_SITE>>
|
<<#HAS_DISPATCH>>
|
||||||
github-site: <<&GITHUB_SITE>>
|
dispatch: true
|
||||||
<</GITHUB_SITE>>
|
<</HAS_DISPATCH>>
|
||||||
<<#GITHUB_API>>
|
|
||||||
github-api: <<&GITHUB_API>>
|
|
||||||
<</GITHUB_API>>
|
|
||||||
|
@ -6,7 +6,6 @@ jobs:
|
|||||||
TagBot:
|
TagBot:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- uses: JuliaRegistries/TagBot@v1
|
- uses: JuliaRegistries/TagBot@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -6,7 +6,6 @@ jobs:
|
|||||||
TagBot:
|
TagBot:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- uses: JuliaRegistries/TagBot@v1
|
- uses: JuliaRegistries/TagBot@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -6,7 +6,6 @@ jobs:
|
|||||||
TagBot:
|
TagBot:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- uses: JuliaRegistries/TagBot@v1
|
- uses: JuliaRegistries/TagBot@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -6,7 +6,6 @@ jobs:
|
|||||||
TagBot:
|
TagBot:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- uses: JuliaRegistries/TagBot@v1
|
- uses: JuliaRegistries/TagBot@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -6,11 +6,8 @@ jobs:
|
|||||||
TagBot:
|
TagBot:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- uses: JuliaRegistries/TagBot@v1
|
- uses: JuliaRegistries/TagBot@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
gpg-key: ${{ secrets.GPG_KEY }}
|
|
||||||
registry: Foo/Bar
|
registry: Foo/Bar
|
||||||
github-site: https://example.com
|
dispatch: true
|
||||||
github-api: https://api.example.com
|
|
||||||
|
@ -76,12 +76,7 @@ end
|
|||||||
License(; name="ISC"),
|
License(; name="ISC"),
|
||||||
ProjectFile(; version=v"1"),
|
ProjectFile(; version=v"1"),
|
||||||
Readme(; inline_badges=true),
|
Readme(; inline_badges=true),
|
||||||
TagBot(;
|
TagBot(; registry="Foo/Bar", dispatch=true),
|
||||||
gpgsign=true,
|
|
||||||
registry="Foo/Bar",
|
|
||||||
github_api="https://api.example.com",
|
|
||||||
github_site="https://example.com",
|
|
||||||
),
|
|
||||||
Tests(; project=true),
|
Tests(; project=true),
|
||||||
TravisCI(;
|
TravisCI(;
|
||||||
coverage=false,
|
coverage=false,
|
||||||
|
@ -48,10 +48,8 @@ const LICENSES_DIR = joinpath(TEMPLATES_DIR, "licenses")
|
|||||||
file: "$(joinpath(TEMPLATES_DIR, "src", "module.jl"))"
|
file: "$(joinpath(TEMPLATES_DIR, "src", "module.jl"))"
|
||||||
TagBot:
|
TagBot:
|
||||||
destination: "TagBot.yml"
|
destination: "TagBot.yml"
|
||||||
gpgsign: false
|
|
||||||
registry: nothing
|
registry: nothing
|
||||||
github_api: nothing
|
dispatch: false
|
||||||
github_site: nothing
|
|
||||||
Tests:
|
Tests:
|
||||||
file: "$(joinpath(TEMPLATES_DIR, "test", "runtests.jl"))"
|
file: "$(joinpath(TEMPLATES_DIR, "test", "runtests.jl"))"
|
||||||
project: false
|
project: false
|
||||||
|
Loading…
Reference in New Issue
Block a user