Skip to content

Commit

Permalink
dict-to-mozc repository change
Browse files Browse the repository at this point in the history
  • Loading branch information
phoepsilonix committed Oct 10, 2024
1 parent ac3081b commit bcb43f4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 61 deletions.
59 changes: 6 additions & 53 deletions .github/workflows/check-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ jobs:
fi
git checkout main
git checkout -- changelog
sed "s/MOZC_VER/${MOZC_TAG_2}/" changelog > changelog.tmp1
UPDATE_DATE=$(LC_ALL=C date -R)
sed "s/MOZC_VER/${MOZC_TAG_2#v*}/" changelog > changelog.tmp1
UPDATE_DATE=$(TZ="Asia/Tokyo" LC_ALL=C date -R)
sed "s/UPDATE_DATE/${UPDATE_DATE}/" -i changelog.tmp1
cat changelog.tmp1 debian/changelog > changelog.tmp
mv changelog.tmp debian/changelog
Expand Down Expand Up @@ -121,8 +121,10 @@ jobs:
echo "mozc_tag=$TAG" >> $GITHUB_OUTPUT
if [[ "$MOZC_TAG_1" != "$MOZC_TAG_2" ]];then
git tag $MOZC_TAG_2 $OSS_COMMIT
git push origin $MOZC_TAG_2 --force
echo $MOZC_TAG_2
echo $OSS_COMMIT
git tag $MOZC_TAG_2 HEAD ||true
git push origin $MOZC_TAG_2 --force||true
fi
- name: Trigger release workflow
Expand All @@ -140,52 +142,3 @@ jobs:
}
}
repository: ${{ github.repository }}

# build_deb
# needs: sync-master
# strategy:
# matrix:
# os: [debian-bookworm, ubuntu-lunar, ubuntu-mantic, ubuntu-noble, debian-bookworm-with-jp-dict, ubuntu-lunar-with-jp-dict, ubuntu-mantic-with-jp-dict, ubuntu-noble-with-jp-dict]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 0

# - name: Configure Git
# run: |
# git config user.name github-actions
# git config user.email [email protected]

# - name: tag
# id: tag
# shell: bash
# run: |
# BRANCH=${{ matrix.os }}
# BRANCH=${BRANCH#*-};
# BRANCH=${BRANCH%-with-jp-dict}
# if [[ "${{ matrix.os }}" =~ "-with-jp-dict" ]]; then
# TAG=with-commit-${BRANCH#*-}-"${{ needs.sync-master.outputs.mozc_commit }}"
# echo "tag=$TAG" >> $GITHUB_OUTPUT
# else
# TAG=commit-${BRANCH#*-}-"${{ needs.sync-master.outputs.mozc_commit }}"
# echo "tag=$TAG" >> $GITHUB_OUTPUT
# fi
# git switch ${{ matrix.os }}
# git tag $TAG
# git push origin $TAG
# - name: Trigger release workflow
# uses: peter-evans/repository-dispatch@v3
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# event-type: new-tag-created
# client-payload: |-
# {
# "repo": {
# "name": "${{ github.repository }}",
# "branch": "${{ matrix.os }}",
# "tag": "${{ steps.tag.outputs.tag }}"
# }
# }
# repository: ${{ github.repository }}
19 changes: 11 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ jobs:
echo $after_tag
TAG=${base_tag}"-${{ matrix.os }}-"${after_tag}
TAG2=${base_tag}"-${{ matrix.os }}-with-jp-dict-"${after_tag}
TAG=${TAG%*-}
TAG2=${TAG2%*-}
echo $TAG
echo $TAG2
cd ..
Expand All @@ -149,6 +151,8 @@ jobs:
after_tag="${tag#*-${{ matrix.os }}}"
TAG=${base_tag}"-${{ matrix.os }}-"${after_tag}
TAG2=${base_tag}"-${{ matrix.os }}-with-jp-dict-"${after_tag}
TAG=${TAG%*-}
TAG2=${TAG2%*-}
git tag $TAG
git tag $TAG2
git push origin $TAG
Expand Down Expand Up @@ -261,10 +265,10 @@ jobs:
echo "Running Rust program for ${{ matrix.os }}"
- name: Added SudachiDict for -with-jp-dict
run: |
git clone --filter=tree:0 --single-branch https://github.com/phoepsilonix/mozcdict-ext.git
cd mozcdict-ext/sudachi
_mozcdict_ext_commit=ae5f2e42e2edfeaa0e3127cf39980ea9889ddda0
git checkout $_mozcdict_ext_commit
git clone --filter=tree:0 --single-branch https://github.com/phoepsilonix/dict-to-mozc.git
cd dict-to-mozc
_dict_to_mozc_commit=e5579de8302d2928a2e04dd03c575f001cebc5dd
git checkout $_dict_to_mozc_commit
. "$HOME/.cargo/env"
_sudachidict_date=$(curl -s 'http://sudachi.s3-website-ap-northeast-1.amazonaws.com/sudachidict-raw/' | grep -o '<td>[0-9]*</td>' | grep -o '[0-9]*' | sort -n | tail -n 1)
curl -LO "http://sudachi.s3-website-ap-northeast-1.amazonaws.com/sudachidict-raw/${_sudachidict_date}/small_lex.zip"
Expand All @@ -278,10 +282,9 @@ jobs:
rustup update stable
rustup target list --installed | grep $(rustc -vV | sed -e 's|host: ||' -e 's|-gnu||p' -n) | grep -v musl && TARGET=$(rustup target list --installed | grep $(rustc -vV | sed -e 's|host: ||' -e 's|-gnu||p' -n)|grep -v musl|head -n1) || TARGET=$(rustup target list --installed | grep $(rustc -vV | sed -e 's|host: ||' -e 's|-gnu||p' -n)|grep musl|head -n1)
cargo build --release --target $TARGET
./target/$TARGET/release/dict-to-mozc -s -i ../../source/src/data/dictionary_oss/id.def -f sudachi.csv > ./all-dict.txt
awk -f dup.awk all-dict.txt > finish-dict.txt
cat finish-dict.txt >> ../../source/src/data/dictionary_oss/dictionary00.txt
rm all-dict.txt finish-dict.txt
./target/$TARGET/release/dict-to-mozc -s -i ../source/src/data/dictionary_oss/id.def -f sudachi.csv > ./all-dict.txt
cat all-dict.txt >> ../source/src/data/dictionary_oss/dictionary00.txt
rm all-dict.txt
- name: Build
shell: bash
run: |
Expand Down
1 change: 1 addition & 0 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ mozc (MOZC_VER+dfsg-2.2build1.1) UNRELEASED; urgency=medium
* bazel build with github.com/google/mozc.git and patches of fcitx5

-- Masato TOYOSHIMA <[email protected]> UPDATE_DATE

0 comments on commit bcb43f4

Please sign in to comment.