Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Julia new lts. Update for Bibliography v0.3 #56

Merged
merged 6 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style = "sciml"
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
37 changes: 32 additions & 5 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,43 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v1
with:
version: "1"
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
15 changes: 15 additions & 0 deletions .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Spell Check

on: [pull_request]

jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/[email protected]
with:
config: ./_typos.toml
16 changes: 16 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ on:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: "3"
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
Expand Down
72 changes: 59 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,81 @@
name: CI
on:
- push
- pull_request
pull_request:
branches:
- master
- dev
paths-ignore:
- "docs/**"
push:
branches:
- master
paths-ignore:
- "docs/**"
jobs:
formatter:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1]
julia-arch: [x86]
os: [ubuntu-latest]
steps:
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}

- uses: actions/checkout@v4
- name: Install JuliaFormatter and format
# This will use the latest version by default but you can set the version like so:
#
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="1.0.50"))'
julia -e 'using JuliaFormatter; format(".", verbose=true)'
- name: Format check
run: |
julia -e '
out = Cmd(`git diff`) |> read |> String
if out == ""
exit(0)
else
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
end'
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- "nightly"
- "lts"
- "1"
- "pre"
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
- x86
exclude:
include:
# test macOS and Windows with latest Julia only
- os: macOS-latest
arch: x86
arch: x64
version: 1
- os: windows-latest
arch: x64
version: 1
- os: windows-latest
arch: x86
version: 1
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand All @@ -42,15 +88,15 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: "1"
- run: |
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/register.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Register Package
on:
workflow_dispatch:
inputs:
version:
description: Version to register or component to bump
required: true
jobs:
register:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: julia-actions/RegisterAction@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 12 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@ Gtk4 = "9db2cae5-386f-4011-9d63-a5602296539b"
SWPGtkExtension = ["Gtk4"]

[compat]
Bibliography = "0.2"
Bibliography = "0.3"
DataStructures = "0.18"
FTPClient = "1"
GitHub = "5"
Gtk4 = "0.3"
julia = "1.9"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"

[targets]
test = ["Aqua", "ExplicitImports", "JET", "Test", "TestItemRunner"]
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ The only available theme for the moment is using Zurb foundation responsive fron

### Items

Items are guaranteed to be compatible with the main theme (and hopefully new ones will be too).
Items are guaranteed to be compatible with the main theme (and hopefully new ones will be too).

##### `Publications` : a bibliography based on a bibliography file (uses [Bibliography.jl]((https://github.com/Humans-of-Julia/Bibliography.jl)))

Expand Down Expand Up @@ -221,18 +221,18 @@ gitrepo = GitRepo( # currently work only with GitHub

Please note that GitHub will restrict unidentified requests to a certain amount per IP within a time limit (that I don't know the value). If it happens, a message error from GitHub API will be returned.

To circumvent this issue, you can uncomment the line `local_info["auth_tokens"] = "PATH/TO/token.jl'` in `run.jl` (or add it if necessary) **and** edit the `token.jl` by updating your Personnal [Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token).
To circumvent this issue, you can uncomment the line `local_info["auth_tokens"] = "PATH/TO/token.jl'` in `run.jl` (or add it if necessary) **and** edit the `token.jl` by updating your Personal [Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token).

`token.jl` aims to store all authentication tokens (for now, just GitHub). It content must be as follow (it is a simple variable containing your PAT):
```julia
# WARNING!
# YOUR TOKENS SHOULD NEVER BE SHARED! IF YOU USE GIT, DON'T FORGET TO ADD `token.jl` TO YOUR `.gitignore` FILE!
# YOU CAN ALSO STORE `token.jl` OUTSIDE OF THE STATICWEBPAGES FOLDER!

github_pat = "YOUR_PERSONAL_ACCESS_TOKEN"
github_pat = "YOUR_PERSONAL_ACCESS_TOKEN"
```

If the token is not valid, a `401: Bad Creditential` error from GitHUb API will be returned.
If the token is not valid, a `401: Bad Creditential` error from GitHub API will be returned.

As the comment states, take care not to push your token to your git repo! A good practice could be to store `token.jl` outside of your git project.

Expand All @@ -242,7 +242,7 @@ As the comment states, take care not to push your token to your git repo! A good
biography = Block(
paragraphs(
"""
Jean-François Baffier is an academic researcher at the RIKEN Center for Advanced Intelligence Project (AIP), and a consultant in Artificial Intelligence, Big Data Science, Data Structures, and Algorithms. As an academic, he gives back to society through fundamental research in computer science supplemented by open source libraries and softwares.
Jean-François Baffier is an academic researcher at the RIKEN Center for Advanced Intelligence Project (AIP), and a consultant in Artificial Intelligence, Big Data Science, Data Structures, and Algorithms. As an academic, he gives back to society through fundamental research in computer science supplemented by open source libraries and software.
""",
"""
paragraph 2
Expand All @@ -266,7 +266,7 @@ research = Block(
Principal Research Projects: Network Interdiction, Compressed Data Structures, Modern Academics, Explainable AI. Other research interest includes Graph Theory, Geometry, Optimization, and Games.
""",
"""
All of this research is supported by Open-Source Softwares and published as peer-review academic papers.
All of this research is supported by Open-Source Software and published as peer-review academic papers.
"""
),
images()
Expand Down Expand Up @@ -388,7 +388,7 @@ email(

##### Link can be an internal or an external link
```julia
link("research project", "research.hmtl") # inner link
link("research project", "research.html") # inner link
link("StaticWebPages.jl", "https://github.com/Humans-of-Julia/StaticWebPages.jl")
```

Expand Down
27 changes: 27 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[default]
extend-ignore-re = [
"iMatix"
]

[files]
extend-exclude = ["*.css", "*.js"]

[default.extend-words]
annote = "annote"
inbrace = "inbrace"
BA = "BA"
FO = "FO"
ND = "ND"

[default.extend-identifiers]
"CC-BY-NC-ND-1.0" = "CC-BY-NC-ND-1.0"
"CC-BY-NC-ND-2.0" = "CC-BY-NC-ND-2.0"
"CC-BY-NC-ND-2.5" = "CC-BY-NC-ND-2.5"
"CC-BY-NC-ND-3.0" = "CC-BY-NC-ND-3.0"
"CC-BY-NC-ND-3.0-IGO" = "CC-BY-NC-ND-3.0-IGO"
"CC-BY-NC-ND-4.0" = "CC-BY-NC-ND-4.0"
"CC-BY-ND-1.0" = "CC-BY-ND-1.0"
"CC-BY-ND-2.0" = "CC-BY-ND-2.0"
"CC-BY-ND-2.5" = "CC-BY-ND-2.5"
"CC-BY-ND-3.0" = "CC-BY-ND-3.0"
"CC-BY-ND-4.0" = "CC-BY-ND-4.0"
33 changes: 17 additions & 16 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@ using StaticWebPages
using Bibliography
using Documenter

@info "Makeing documentation..."
@info "Making documentation..."
makedocs(;
modules=[StaticWebPages, Bibliography],
authors="Jean-François Baffier",
repo="https://github.com/Humans-of-Julia/StaticWebPages.jl/blob/{commit}{path}#L{line}",
sitename="StaticWebPages.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://Humans-of-Julia.github.io/StaticWebPages.jl",
assets = ["assets/favicon.ico"; "assets/github_buttons.js"; "assets/custom.css"],
modules = [StaticWebPages, Bibliography],
authors = "Jean-François Baffier",
repo = "https://github.com/Humans-of-Julia/StaticWebPages.jl/blob/{commit}{path}#L{line}",
sitename = "StaticWebPages.jl",
format = Documenter.HTML(;
prettyurls = get(ENV, "CI", "false") == "true",
canonical = "https://Humans-of-Julia.github.io/StaticWebPages.jl",
assets = ["assets/favicon.ico"; "assets/github_buttons.js"; "assets/custom.css"]
),
pages=[
pages = [
"Home" => "index.md",
"Components" => [
"Theming" => "themes.md",
"Items" => "items.md",
"Pages" => "pages.md",
"Pages" => "pages.md"
],
"Dependencies" => [
"Bibliography.jl" => "bibliography.md",
"Bibliography.jl" => "bibliography.md"
],
"Library" => [
"public.md",
"internal.md",
],
],
"internal.md"
]
]
)

deploydocs(; repo = "github.com/Humans-of-Julia/StaticWebPages.jl.git", devbranch = "master")
deploydocs(;
repo = "github.com/Humans-of-Julia/StaticWebPages.jl.git", devbranch = "master")
Loading
Loading