Build dictionary #60
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build dictionary | |
on: | |
push: | |
branches: | |
- pkg-moegirl | |
workflow_dispatch: {} | |
permissions: | |
contents: write | |
jobs: | |
build-and-publish: | |
if: (contains(github.event_name, 'schedule') || !contains(github.event.commits[0].message, 'ci ckip')) | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref_name }} | |
persist-credentials: false | |
fetch-depth: '0' | |
path: 'toolkit' | |
- name: Build dictionary | |
run: | | |
mkdir $GITHUB_WORKSPACE/artifacts | |
docker run -v $GITHUB_WORKSPACE/artifacts:/artifacts -v $GITHUB_WORKSPACE/toolkit:/toolkit archlinux:base-devel bash /toolkit/utils/build.sh | |
- name: Checkout profile | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref_name }} | |
persist-credentials: false | |
fetch-depth: '0' | |
path: 'profile' | |
- name: Update date | |
run: | | |
pushd profile | |
export DATE=`date +%Y%m%d` | |
echo $DATE > LATEST | |
git add ./LATEST | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git commit -m "chore: version $DATE" | |
popd | |
- name: Push the commit | |
uses: ad-m/github-push-action@master | |
with: | |
branch: ${{ github.ref_name }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
directory: profile | |
- name: Release | |
shell: bash | |
run: | | |
export DATE=`date +%Y%m%d` | |
wget https://github.com/tcnksm/ghr/releases/download/v0.15.0/ghr_v0.15.0_linux_amd64.tar.gz -O ghr.tgz | |
tar xzf ghr.tgz | |
pushd profile | |
export COMMIT=$(git rev-parse HEAD) | |
popd | |
ghr_v0.15.0_linux_amd64/ghr -t ${{ secrets.GITHUB_TOKEN }} -u ${GITHUB_REPOSITORY/\/*/} -r ${GITHUB_REPOSITORY/*\//} -c "$COMMIT" -delete ${DATE} ./artifacts/ |