Skip to content

Publish release

Publish release #9

Workflow file for this run

name: Publish release
on:
workflow_dispatch:
jobs:
# generate-release-first: # Not needed for now because any push to main will trigger a build
# uses: ./.github/workflows/release.yml
publish:
runs-on: ubuntu-latest
# needs: generate-release-first # Not needed for now because any push to main will trigger a build
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} # Branch to merge into main
steps:
- name: Fail if branch is not main
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main'
run: |
echo "This workflow should not be triggered manually on a branch other than main"
exit 1
- uses: actions/checkout@v4
- name: Bump version and push tag
id: tag
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
create_annotated_tag: true
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: release.yml
skip_unpack: true
- name: Inspect project files
run: ls -lR
- name: Setup release files
run: |
unzip 3d.step.zip
mv 3d.step 3d-${{ steps.tag.outputs.new_tag }}.step
mv manufacturing.zip manufacturing-${{ steps.tag.outputs.new_tag }}.zip
mv release.zip release-${{ steps.tag.outputs.new_tag }}.zip
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag.outputs.new_tag }}
name: Release ${{ steps.tag.outputs.new_tag }}
body: ${{ steps.tag.outputs.changelog }}
artifacts: "3d-${{ steps.tag.outputs.new_tag }}.step,manufacturing-${{ steps.tag.outputs.new_tag }}.zip,release-${{ steps.tag.outputs.new_tag }}.zip"