Skip to content

Commit

Permalink
Adding CICD (#23)
Browse files Browse the repository at this point in the history
* Adding workflow for GitHub pre-release

* Updating CICD

* Renaming workflows folder

* Updating CICD

* Updating permissions on workflows

* Updating permissions for workflow

* Updating CICD

* Updating CICD

* Updating CICD

* Updated CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updated CICD

* Updated CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updated CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updated CMakeLists

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD

* Updating CICD
  • Loading branch information
HarryHeres authored Oct 12, 2024
1 parent 5527c25 commit 3482b31
Show file tree
Hide file tree
Showing 14 changed files with 2,989 additions and 1 deletion.
59 changes: 59 additions & 0 deletions .github/workflows/create-pre-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Create and publish pre-release

on:
push:
branches:
- 'cicd'
workflow_dispatch:

jobs:
create-pre-release:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Parse current version
id: get-app-version
run: echo "VERSION=$(cat SlicerBoneMorphing/SlicerBoneMorphing.py | grep Version | awk '{print $2}')" >> $GITHUB_OUTPUT

- name: Temporary CHANGELOG update
env:
VERSION: ${{steps.get-app-version.outputs.version}}
run: sed -i "s/\[Unreleased\]/\[${VERSION}\] - $(date +%Y-%m-%d)/" CHANGELOG.md

- name: Create ZIP archive
env:
VERSION: ${{steps.get-app-version.outputs.version}}
run: |
cd SlicerBoneMorphing
zip -r SlicerBoneMorphing-$VERSION.zip ./*
cp SlicerBoneMorphing-$VERSION.zip ../
cd ..
- name: Create pre-release
id: create-pre-release
uses: actions/create-release@v1
env:
VERSION: ${{ steps.get-app-version.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_name: v${{ env.VERSION }}
tag_name: v${{ env.VERSION }}
body_path: CHANGELOG.md
draft: false
prerelease: true

- name: Upload artifacts
uses: actions/upload-release-asset@v1
env:
VERSION: ${{ steps.get-app-version.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-pre-release.outputs.upload_url }}
asset_path: SlicerBoneMorphing-${{ env.VERSION }}.zip
asset_name: "SlicerBoneMorphing-${{ env.VERSION }}.zip"
asset_content_type: application/gzip
Loading

0 comments on commit 3482b31

Please sign in to comment.