Skip to content

0.1.7

0.1.7 #7

Workflow file for this run

name: Publish
on:
release:
types:
- created
jobs:
update-version-and-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
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 'github-actions@users.noreply.github.com'
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@v3
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/build.yml
with:
CIBW_SKIP: "pp* cp36-* cp37-*"
CIBW_BUILD: "cp*-macosx* cp*-manylinux*"
VERSION: ${{ github.ref_name }}
secrets: inherit
release-python-package:
needs: [external-build-workflow, update-version-and-changelog]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact # if `name: artifact` is omitted, the action will create extra parent dir
path: dist
# TODO: Trusted publishing
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
sync-to-hf-hub:
needs: update-version-and-changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download hf repo
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@users.noreply.github.com'
git clone https://k4black:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/k4black/codebleu 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 "Auto files update [${{ github.ref_name }}]"
ls -lah
git push https://k4black:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/k4black/codebleu main