Release-vanilla/1.0.2 #33
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: Release | |
on: | |
pull_request: | |
branches: | |
- vanilla | |
types: | |
- closed | |
jobs: | |
tagging: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release-vanilla/') | |
steps: | |
- name: Determine the tag name based on the branch name | |
id: get_version | |
run: | | |
echo "TAG=$(echo $BRANCH | cut -d / -f 2)" >> $GITHUB_OUTPUT | |
env: | |
BRANCH: ${{ github.event.pull_request.head.ref }} | |
- name: Echo tag | |
run: echo ${{ steps.get_version.outputs.TAG }} | |
- uses: actions/checkout@v2 | |
- run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git fetch origin ${{ github.event.pull_request.head.ref }} | |
git checkout vanilla | |
git tag -a `echo '${{ github.event.pull_request.head.ref }}' | sed 's/release-vanilla\//vanilla-/'` -m " " | |
git push origin `echo '${{ github.event.pull_request.head.ref }}' | sed 's/release-vanilla\//vanilla-/'` | |
build_and_release: | |
name: build_and_release | |
needs: [tagging] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Determine the tag name based on the branch name | |
id: get_version | |
run: | | |
echo "TAG=$(echo $BRANCH | cut -d / -f 2)" >> $GITHUB_OUTPUT | |
env: | |
BRANCH: ${{ github.event.pull_request.head.ref }} | |
- uses: actions/checkout@v2 | |
- name: change branch | |
run: | | |
git checkout vanilla | |
- name: Install dependencies | |
run: | | |
python -m pip install huggingface_hub | |
- name: Build | |
run: | | |
sudo apt install -y jq | |
bash utils/build.sh | |
- name: create zip for release | |
run: | | |
mkdir release-vanilla-${{ steps.get_version.outputs.TAG }}-cc-by-sa | |
mkdir release-vanilla-${{ steps.get_version.outputs.TAG }}-mit | |
cp data.jsonl release-vanilla-${{ steps.get_version.outputs.TAG }}-mit | |
cp data-cc-by-sa.jsonl release-vanilla-${{ steps.get_version.outputs.TAG }}-cc-by-sa | |
cp datasets/LICENSE release-vanilla-${{ steps.get_version.outputs.TAG }}-mit | |
cp datasets/NOTICE.md release-vanilla-${{ steps.get_version.outputs.TAG }}-mit | |
cp datasets-cc-by-sa/LICENSE release-vanilla-${{ steps.get_version.outputs.TAG }}-cc-by-sa | |
cp datasets-cc-by-sa/NOTICE.md release-vanilla-${{ steps.get_version.outputs.TAG }}-cc-by-sa | |
cp datasets/NOTICE.md release-vanilla-${{ steps.get_version.outputs.TAG }}-cc-by-sa/NOTICE2.md | |
zip release-vanilla-${{ steps.get_version.outputs.TAG }}-mit.zip -r release-vanilla-${{ steps.get_version.outputs.TAG }}-mit | |
zip release-vanilla-${{ steps.get_version.outputs.TAG }}-cc-by-sa.zip -r release-vanilla-${{ steps.get_version.outputs.TAG }}-cc-by-sa | |
- name: Push a release to GitHub. At the beginning of release, the body of pull request is shown. | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: vanilla-${{ steps.get_version.outputs.TAG }} | |
release_name: vanilla-${{ steps.get_version.outputs.TAG }} | |
draft: false | |
prerelease: false | |
body: | | |
${{ github.event.pull_request.body }} | |
This release is automatically generated. | |
Please see the pull request for more details. | |
[${{ github.event.pull_request.html_url }}](${{ github.event.pull_request.html_url }}) | |
- name: Generate checksum for all elements in dist directory | |
run: | | |
sha256sum release-vanilla-${{ steps.get_version.outputs.TAG }}-mit.zip > release-vanilla-${{ steps.get_version.outputs.TAG }}-mit-checksums.txt | |
sha256sum release-vanilla-${{ steps.get_version.outputs.TAG }}-cc-by-sa.zip > release-vanilla-${{ steps.get_version.outputs.TAG }}-cc-by-sa-checksums.txt | |
- name: Attach an archive of source files to the release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: release-vanilla-${{ steps.get_version.outputs.TAG }}-mit.zip | |
asset_name: release-vanilla-${{ steps.get_version.outputs.TAG }}-mit.zip | |
asset_content_type: application/zip | |
- name: Attach an archive of source files to the release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: release-vanilla-${{ steps.get_version.outputs.TAG }}-cc-by-sa.zip | |
asset_name: release-vanilla-${{ steps.get_version.outputs.TAG }}-cc-by-sa.zip | |
asset_content_type: application/zip | |
- name: Attach an archive of source files to the release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: release-vanilla-${{ steps.get_version.outputs.TAG }}-mit-checksums.txt | |
asset_name: release-vanilla-${{ steps.get_version.outputs.TAG }}-mit-checksums.txt | |
asset_content_type: text/plain | |
- name: Attach an archive of source files to the release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: release-vanilla-${{ steps.get_version.outputs.TAG }}-cc-by-sa-checksums.txt | |
asset_name: release-vanilla-${{ steps.get_version.outputs.TAG }}-cc-by-sa-checksums.txt | |
asset_content_type: text/plain | |
- name: git lfs install | |
run: | | |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash | |
sudo apt-get install git-lfs | |
git lfs install | |
- name: hugging face upload_url | |
run: | | |
huggingface-cli login --token ${{ secrets.HUGGING_FACE_SECRET }} | |
git clone https://git:${{ secrets.HUGGING_FACE_SECRET }}@huggingface.co/datasets/izumi-lab/llm-japanese-dataset-vanilla | |
cp data-cc-by-sa.jsonl llm-japanese-dataset-vanilla | |
cp datasets-cc-by-sa/LICENSE llm-japanese-dataset-vanilla | |
cp datasets-cc-by-sa/NOTICE.md llm-japanese-dataset-vanilla | |
cp datasets/NOTICE.md llm-japanese-dataset-vanilla/NOTICE2.md | |
cp version.py llm-japanese-dataset-vanilla | |
cd llm-japanese-dataset-vanilla | |
git lfs track *.jsonl | |
git add data-cc-by-sa.jsonl LICENSE NOTICE.md NOTICE2.md version.py | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git commit -m "Release vanilla-${{ steps.get_version.outputs.TAG }}" | |
git tag -a "${{ steps.get_version.outputs.TAG }}" -m " " | |
git push | |
git push origin ${{ steps.get_version.outputs.TAG }} | |
delete-branch: | |
runs-on: ubuntu-latest | |
needs: [tagging, build_and_release] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Delete the release branch | |
run: | | |
git push --delete origin ${{ github.event.pull_request.head.ref }} |