build: use release-please and auto tagging
This commit is contained in:
parent
ef5f8d2b12
commit
cea4696ac0
|
@ -7,15 +7,51 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-and-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: teatimeguest/setup-texlive-action@v3
|
- uses: teatimeguest/setup-texlive-action@v3
|
||||||
with:
|
with:
|
||||||
packages: scheme-full
|
packages: scheme-full
|
||||||
- name: Build and test LaTeX package
|
- name: check
|
||||||
|
run: l3build check
|
||||||
|
- name: document
|
||||||
|
run: l3build doc
|
||||||
|
- name: install
|
||||||
|
run: l3build install
|
||||||
|
release:
|
||||||
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
needs:
|
||||||
|
- build-and-test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: google-github-actions/release-please-action@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
|
||||||
|
release-type: simple
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
if: ${{ steps.release.outputs.prs_created }}
|
||||||
|
- uses: teatimeguest/setup-texlive-action@v3
|
||||||
|
with:
|
||||||
|
packages: scheme-basic
|
||||||
|
if: ${{ steps.release.outputs.prs_created }}
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: refs/pull/${{ steps.release.outputs.pr.number }}/merge
|
||||||
|
if: ${{ steps.release.outputs.prs_created }}
|
||||||
|
- name: tag
|
||||||
|
run: l3build tag 0.1.0
|
||||||
|
if: ${{ steps.release.outputs.prs_created }}
|
||||||
|
- name: Commit and push
|
||||||
run: |
|
run: |
|
||||||
l3build check
|
git config --local user.email "action@github.com"
|
||||||
l3build doc
|
git config --local user.name "GitHub Action"
|
||||||
l3build install
|
git add .
|
||||||
|
git commit -m "chore: tag files"
|
||||||
|
git push
|
||||||
|
if: ${{ steps.release.outputs.prs_created }}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
".": "0.1.0"
|
||||||
|
}
|
35
build.lua
35
build.lua
|
@ -2,20 +2,25 @@
|
||||||
|
|
||||||
module = "moloch"
|
module = "moloch"
|
||||||
|
|
||||||
-- sourcefiledir = "src"
|
|
||||||
--
|
|
||||||
-- installfiles = {"*.sty"}
|
|
||||||
-- sourcefiles = {"src/*.dtx"}
|
|
||||||
-- typesetfiles = {"src/*.dtx"}
|
|
||||||
|
|
||||||
sourcefiledir = "src"
|
sourcefiledir = "src"
|
||||||
-- docfiledir = "docs"
|
typesetfiles = { "doc/moloch.tex" }
|
||||||
-- unpackfiles = { "*.dtx" }
|
|
||||||
-- -- typesetfiles = { "*.dtx", "*.tex" }
|
|
||||||
-- typesetfiles = { "moloch.dtx" }
|
|
||||||
-- installfiles = {"*.sty", "*.dtx"}
|
|
||||||
-- packtdszip = true
|
|
||||||
|
|
||||||
typesetfiles = {"doc/moloch.tex"}
|
function update_tag(file, content, tagname, tagdate)
|
||||||
-- sourcefiles = {"src/*.dtx"}
|
if string.match(file, "%.dtx$") then
|
||||||
-- docfiles = {"doc/*.tex"}
|
local pattern = "\\ProvidesPackage{(.-)}%[([^%]]-) v([^%]]-) ([^%]]-)%]"
|
||||||
|
return content:gsub(
|
||||||
|
pattern,
|
||||||
|
function(package_name, old_date, old_version, description)
|
||||||
|
return string.format(
|
||||||
|
"\\ProvidesPackage{%s}[%s v%s %s]",
|
||||||
|
package_name,
|
||||||
|
tagdate,
|
||||||
|
tagname,
|
||||||
|
description
|
||||||
|
)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
return content
|
||||||
|
end
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"packages": {
|
||||||
|
".": {
|
||||||
|
"release-type": "simple",
|
||||||
|
"bump-minor-pre-major": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
0.1.0
|
Loading…
Reference in New Issue