Skip to content

Release with manage-ohb-docker.sh asset #23

Release with manage-ohb-docker.sh asset

Release with manage-ohb-docker.sh asset #23

Workflow file for this run

name: Release with manage-ohb-docker.sh asset
on:
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name (e.g., v0.0.1)'
required: true
default: 'v0.0.0'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # Required to create releases
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Prepare assets
run: |
# Define asset names with the tag
TAG="${{ github.event.inputs.tag_name }}"
REF="${{ github.ref_name }}"
MGR_NAME="manage-ohb-docker-$TAG.sh"
# create a manager with version in the name and file
sed "s/^\(OHB_MANAGER_VERSION=\).*$/\1$TAG/" ./docker/manage-ohb-docker.sh \
> "./docker/$MGR_NAME"
# add version artifact
echo "TAG=$TAG" > VERSION.txt
# create the tars and zips
mkdir dist
tar -czf "dist/OHB-$TAG.tar.gz" --exclude=dist .
zip -r "dist/OHB-$TAG.zip" . -x "dist/*"
- name: Create Release and Upload Asset
env:
GH_TOKEN: ${{ github.token }}
run: |
# Grabs file from repo tree and uploads with a label
gh release create ${{ github.event.inputs.tag_name }} \
"./docker/manage-ohb-docker-${{ github.event.inputs.tag_name }}.sh#Manage OHB Docker Installs" \
"dist/OHB-${{ github.event.inputs.tag_name }}.tar.gz#OHB Source Tarball" \
"dist/OHB-${{ github.event.inputs.tag_name }}.zip#OHB Source Zip" \
--title "OHB Release: ${{ github.event.inputs.tag_name }}" \
--generate-notes