Skip to content

chore: update pre-commit hooks (#70) #50

chore: update pre-commit hooks (#70)

chore: update pre-commit hooks (#70) #50

Workflow file for this run

name: ci-release
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
if: "github.repository_owner == 'SciTools'"
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
env:
WF_VERSION_FNAME: "version.txt"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "calculate release version"
run: |
git pull
if [ -f "${WF_VERSION_FNAME}" ]
then
WF_VERSION=$(cat ${WF_VERSION_FNAME})
WF_DATE=$(echo ${WF_VERSION} | cut -d. -f1-2)
WF_SERIAL=$(echo ${WF_VERSION} | cut -d. -f3)
NOW_DATE=$(date +%Y.%m)
NOW_SERIAL=0
if [ "${WF_DATE}" == "${NOW_DATE}" ]
then
NOW_SERIAL=$(expr ${WF_SERIAL} + 1)
fi
WF_VERSION="${NOW_DATE}.${NOW_SERIAL}"
else
WF_VERSION="$(date +%Y.%m).0"
echo "WF_BOOTSTRAP=1" >> ${GITHUB_ENV}
fi
echo "WF_VERSION=${WF_VERSION}" >> ${GITHUB_ENV}
- name: "store release version"
run: |
echo ${{ env.WF_VERSION }} > ${WF_VERSION_FNAME}
if [ -n "${WF_BOOTSTRAP}" ]
then
git add ${WF_VERSION_FNAME}
fi
git config user.name "GitHub Actions"
git config user.email "actions@users.noreply.github.com"
git commit -am "Automated release for version \"${WF_VERSION}\""
git push
- name: "perform release"
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
with:
tag_name: ${{ env.WF_VERSION }}