Release with manage-hc-docker.sh asset #10
This file contains hidden or 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 with manage-hc-docker.sh asset | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag_name: | |
| description: 'Tag name (e.g., 0.0.1)' | |
| required: true | |
| default: '0.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-hc-docker-$TAG.sh" | |
| # create a manager with version in the name and file | |
| sed "s/^\(HC_MANAGER_VERSION=\).*$/\1$TAG/" ./docker/manage-hc-docker.sh \ | |
| > "./docker/$MGR_NAME" | |
| # add version artifact | |
| echo "TAG=$TAG" > VERSION.txt | |
| # create the tars and zips | |
| mkdir dist | |
| tar -czf "dist/HC-$TAG.tar.gz" --exclude=dist . | |
| zip -r "dist/HC-$TAG.zip" . -x "dist/*" | |
| # zip file for HamClock upgrades | |
| zip -r "dist/ESPHamClock-$TAG.zip" ESPHamClock -x "dist/*" | |
| cp "dist/ESPHamClock-$TAG.zip" "dist/ESPHamClock.zip" | |
| zip -r "dist/hamclock-contrib.zip" hamclock-contrib -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-hc-docker-${{ github.event.inputs.tag_name }}.sh#Manage Hamclock Docker Installs" \ | |
| "dist/ESPHamClock.zip#Hamclock Source Zip" \ | |
| "dist/ESPHamClock-V${{ github.event.inputs.tag_name }}.zip#Hamclock Source Zip" \ | |
| --title "Hamclock Release: ${{ github.event.inputs.tag_name }}" \ | |
| --generate-notes |