Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/assemble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: assemble dictionary

# Stage B (lightweight): merge cached + live sources, filter, score, emit a
# `.combined` wordlist; open a PR for human review. The compiled `.dict` is
# produced from a merged PR by the release-dict workflow (not yet authored).
# produced and published on release by release.yml (Release Please).

on:
schedule:
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: release

# Release Please maintains a release PR from Conventional Commits on main.
# When that PR merges, it tags the commit and creates a GitHub Release; the
# publish-dict job then compiles the puhekieli `.dict` and attaches it to the
# release as a stable, versioned download (consumed by Workstream B).

on:
push:
branches: [main]

permissions:
contents: write
pull-requests: write

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

publish-dict:
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.release-please.outputs.tag_name }}
- name: install libvoikko + Finnish dictionary
run: |
sudo apt-get update
sudo apt-get install -y libvoikko-dev voikko-fi
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: extractions/setup-just@v2
- name: set up JDK (for dicttool)
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: build .combined + compile .dict
# Downloads the OpenSubtitles corpus + dicttool jar, assembles the
# wordlist (always includes the committed curated seed; Mastodon is
# skipped — no cache in a fresh checkout), and compiles the .dict.
run: just generate
- name: stage versioned artifacts
env:
TAG: ${{ needs.release-please.outputs.tag_name }}
run: |
mkdir -p dist
cp data/out/puhekieli_fi.dict "dist/puhekieli_fi-${TAG}.dict"
cp data/out/niinku.combined "dist/niinku-${TAG}.combined"
ls -l dist
- name: attach artifacts to the release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.release-please.outputs.tag_name }}
run: gh release upload "$TAG" dist/* --clobber
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.1"
}
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
license = "MIT"
repository = "https://github.com/laurigates/niinku"
authors = ["Lauri Gates"]
version = "0.0.1"
version = "0.0.1" # x-release-please-version

[workspace.dependencies]
anyhow = "1"
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ just ingest-mastodon # pull Finnish hashtag posts → data/cached/mastodon-fi.tx
just ingest # pass through to the CLI (e.g. `just ingest mastodon --tags suomi`)
```

The `.dict` file ships at `data/out/puhekieli_fi.dict`. To use it:
Pre-built `.dict` files are attached to each
[GitHub Release](https://github.com/laurigates/niinku/releases) as
`puhekieli_fi-<version>.dict` (built automatically — see CI/CD below).
You can also build one locally with `just generate`, which writes
`data/out/puhekieli_fi.dict`. To use it:

1. Transfer to an Android device that has HeliBoard installed.
2. Settings → Languages → Finnish → "Add dictionary from file" → select the `.dict`.
Expand Down Expand Up @@ -164,8 +168,13 @@ it.
- Scheduled `cron` (monthly suggested) runs Stage B.
- The job does **not** auto-publish. It opens a PR containing the regenerated
wordlist plus a diff of new-vs-removed entries. A human merges.
- On merge, the compiled `.dict` is published as a GitHub Release artifact at
a stable URL (consumed by Workstream B).
- Releases are cut by [Release Please](https://github.com/googleapis/release-please)
(`release.yml`): it maintains a release PR from Conventional Commits on
`main`; merging it tags the commit and creates a GitHub Release.
- On release, `release.yml` compiles the `.dict` and attaches it (plus the
`.combined` source) to the release as a stable, versioned download
(consumed by Workstream B). Version bumps are driven by commit type
(`feat:` → minor, `fix:` → patch) — see [Conventional Commits](https://www.conventionalcommits.org).

### Repo layout

Expand All @@ -181,6 +190,7 @@ it.
/.github/workflows
ingest.yml # Stage A, manual / version-triggered
assemble.yml # Stage B, cron + PR
release.yml # Release Please + compile/publish .dict on release
ci.yml # fmt, clippy, test
/tools
dicttool_aosp.jar # not yet vendored
Expand Down
14 changes: 14 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "simple",
"package-name": "niinku",
"changelog-path": "CHANGELOG.md",
"include-component-in-tag": false,
"extra-files": [
"Cargo.toml"
]
}
}
}
Loading