Skip to content

0.6.0

0.6.0 #13

Workflow file for this run

name: Publish
on:
release:
types:
- created
jobs:
update-version-and-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Update version file
run: |
cat VERSION
echo "VERSION ${{ github.ref_name }}"
echo -n "${{ github.ref_name }}" > VERSION
- name: Update changelog file
run: |
echo "CHANGELOG"
- name: Commit updated files
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git add VERSION CHANGELOG.md
git commit -m "Auto version and changelog update [${{ github.ref_name }}]"
git push origin
- name: Tag new commit
run: |
git tag --force ${{ github.ref_name }}
git push origin ${{ github.ref_name }} --force
update-release-github:
needs: update-version-and-changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Update Release description
run: |
echo "VERSION"
echo "CHANGELOG"
external-build-workflow:
needs: update-version-and-changelog
uses: ./.github/workflows/reusable-build.yml
with:
CIBW_SKIP: "pp* cp36-* cp37-*"
CIBW_BUILD: "cp*-macosx* cp*-manylinux* cp*-win*"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_ARCHS_LINUX: "x86_64 aarch64"
CIBW_ARCHS_WINDOWS: "x86"
VERSION: ${{ github.ref_name }}
secrets: inherit
release-python-package:
needs: [external-build-workflow, update-version-and-changelog]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/codebleu
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
name: artifact # if `name: artifact` is omitted, the action will create extra parent dir
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
sync-to-hf-hub:
needs: update-version-and-changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download hf repo
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git clone https://k4black:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/k4black/codebleu hf_evaluate_codebleu
cd hf_evaluate_codebleu
git checkout main
- name: Update files and push
run: |
cp -r evaluate_app/* hf_evaluate_codebleu
cd hf_evaluate_codebleu
git add .
git commit --allow-empty -m "chore(auto): update changelog and version [${{ github.ref_name }}]"
ls -lah
git push https://k4black:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/k4black/codebleu main