Skip to content

Bugfix in automatic release workflow #3

Bugfix in automatic release workflow

Bugfix in automatic release workflow #3

Workflow file for this run

on:
pull_request:
types:
- closed
jobs:
if_merged:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout corpus repository
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.MS3_BOT_TOKEN }}
ref: "${{ github.event.pull_request.base.ref }}"
submodules: recursive
- name: "Get latest tag version"
id: tag
continue-on-error: true
run: |
res=$(git tag -l --sort=-v:refname | grep --invert-match '\^' | head -n 1)
echo "tag_version=${res}" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.MS3_BOT_TOKEN }}
- name: "Generate a new tag version"
id: generate_tag
run: |
major_in_PR="${{ contains(github.event.pull_request.labels.*.name, 'major_version')}}"
python .github/workflows/helper.py --tag "${{ steps.tag.outputs.tag_version }}" --update_major_ver "$major_in_PR"
- name: Setup Github credentials & push zenodo, citation and README changes
continue-on-error: true
run: |
git config --global user.name "ms3-bot"
git config --global user.email [email protected]
if [[ -f .zenodo.json ]]; then
git add .zenodo.json
fi
if [[ -f CITATION.cff ]]; then
git add CITATION.cff
fi
if [[ -f README.md ]]; then
git add README.md
fi
git commit -m 'chore: files updated with tag: ${{ steps.generate_tag.outputs.new_tag }}'
git push
- name: "Create tag"
run: |
git tag -a "${{ steps.generate_tag.outputs.new_tag }}" -m "chore: files updated with tag: ${{ steps.generate_tag.outputs.new_tag }}"
git push origin "${{ steps.generate_tag.outputs.new_tag }}"
- name: "Get ms3 package & apply transform"
continue-on-error: true
run: |
pip install --upgrade pip
pip install ms3
ms3 transform -M -N -X -F -C -D
- name: "Store lowercase repo name"
run: |
echo "REPO=${GITHUB_REPOSITORY@L}" >> ${GITHUB_ENV}
- uses: ncipollo/release-action@v1
with:
artifacts: "${REPO}.zip,\
${REPO}.datapackage.json,\
${REPO}.datapackage.errors"
body: "${{ github.event.pull_request.body }}"
name: "${{ github.event.pull_request.title }}"
tag: "${{ steps.generate_tag.outputs.new_tag }}"
makeLatest: "latest"