2024-09-27 18:01:17 -07:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_run:
|
|
|
|
workflows: [Build]
|
|
|
|
types: [completed]
|
|
|
|
branches-ignore:
|
|
|
|
- release
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: Create release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
ref: ${{ github.event.workflow_run.head_branch }}
|
|
|
|
fetch-depth: 0
|
|
|
|
lfs: false
|
2024-09-29 23:30:36 -07:00
|
|
|
- name: Get latest tag
|
|
|
|
id: get_latest_tag
|
|
|
|
run: |
|
|
|
|
latest_tag=$(git describe --tags --abbrev=0)
|
|
|
|
echo "LATEST_TAG=${latest_tag}" >> $GITHUB_OUTPUT
|
2024-09-27 18:01:17 -07:00
|
|
|
- name: Create release
|
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2024-09-29 23:30:36 -07:00
|
|
|
tag_name: release_${{ steps.get_latest_tag.outputs.LATEST_TAG }}
|
|
|
|
release_name: Release ${{ steps.get_latest_tag.outputs.LATEST_TAG }}
|
2024-09-27 18:01:17 -07:00
|
|
|
body_path: RELEASE.md
|
|
|
|
draft: false
|
|
|
|
prerelease: false
|
|
|
|
- uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
path: build
|
|
|
|
merge-multiple: true
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run-id: ${{ github.event.workflow_run.id }}
|
|
|
|
- name: Upload Windows release assets
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_name: micromissiles-${{ github.event.workflow_run.head_branch }}-windows_x86_64.zip
|
|
|
|
asset_path: build/build-StandaloneWindows64.zip
|
|
|
|
asset_content_type: application/zip
|
|
|
|
- name: Upload Darwin release assets
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_name: micromissiles-${{ github.event.workflow_run.head_branch }}-darwin.tar.gz
|
|
|
|
asset_path: build/build-StandaloneOSX.tar.gz
|
|
|
|
asset_content_type: application/gzip
|