Release 3ob-ophyd-1-2 #2
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: | |
push: | |
tags: | |
- v[0-9]*.[0-9]*.[0-9]* | |
env: | |
SKF_NAME: "${{ github.event.repository.name }}" | |
jobs: | |
skf-archive: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sk set | |
uses: actions/checkout@v4 | |
- name: Get version number | |
run: | | |
GIT_TAG=$(git describe --tags --match 'v[0-9]*.[0-9]*.[0-9]*') | |
SKF_VERSION=$(echo $GIT_TAG | sed -E 's/^v([0-9]+)\.([0-9])+\.([0-9]+)$/\1-\2/') | |
SKF_PATCH=$(echo $GIT_TAG | sed -E 's/^v([0-9]+)\.([0-9])+\.([0-9]+)$/\3/') | |
echo "SKF_VERSION=${SKF_VERSION}" >> ${GITHUB_ENV} | |
echo "SKF_PATCH=${SKF_PATCH}" >> ${GITHUB_ENV} | |
ARCHIVE_NAME="${SKF_NAME}-${SKF_VERSION}" | |
echo "ARCHIVE_NAME=${ARCHIVE_NAME}" >> ${GITHUB_ENV} | |
if [[ ${SKF_PATCH} -eq 0 ]]; then | |
echo "RELEASE_NAME=${ARCHIVE_NAME}" >> ${GITHUB_ENV} | |
else | |
echo "RELEASE_NAME=${ARCHIVE_NAME} (p${SKF_PATCH})" >> ${GITHUB_ENV} | |
fi | |
- name: Create archive | |
run: | | |
mkdir -p _build/${ARCHIVE_NAME} | |
cp $(find . -maxdepth 1 -not -type 'd') _build/${ARCHIVE_NAME} | |
cp -a skfiles/* _build/${ARCHIVE_NAME} | |
tar -C _build -c -v -J -f ${ARCHIVE_NAME}.tar.xz ${ARCHIVE_NAME} | |
# mkdir -p _build/${ARCHIVE_NAME}-extras | |
# cp -r extras/* _build/${ARCHIVE_NAME}-extras | |
# tar -C _build -c -v -J -f ${ARCHIVE_NAME}-extras.tar.xz ${ARCHIVE_NAME}-extras | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: ${{ env.RELEASE_NAME }} | |
preserve_order: True | |
files: | | |
${{ env.ARCHIVE_NAME }}.tar.xz | |
# ${{ env.ARCHIVE_NAME }}-extras.tar.xz | |
body_path: RELEASE.md | |