73 lines
2.3 KiB
YAML
73 lines
2.3 KiB
YAML
name: Deploy to GitHub
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*-r[0-9]+'
|
|
|
|
workflow_dispatch:
|
|
inputs:
|
|
ref:
|
|
description: Tag
|
|
required: true
|
|
|
|
jobs:
|
|
package:
|
|
uses: ./.github/workflows/package.yml
|
|
with:
|
|
dfhack_ref: ${{ github.event.inputs && github.event.inputs.ref || github.event.ref }}
|
|
append-date-and-hash: false
|
|
cache-readonly: true
|
|
launchdf: true
|
|
secrets: inherit
|
|
|
|
create-update-release:
|
|
name: Draft GitHub release
|
|
needs: package
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Clone DFHack
|
|
uses: actions/checkout@v3
|
|
with:
|
|
ref: ${{ github.event.inputs && github.event.inputs.ref || github.event.ref }}
|
|
submodules: true
|
|
- name: Get tag
|
|
id: gettag
|
|
run: echo name=$(git describe --tags --abbrev=0 --exact-match) >> $GITHUB_OUTPUT
|
|
- name: Generate release text
|
|
run: |
|
|
python docs/gen_changelog.py -a
|
|
TOKEN_LINE=$(grep -Fhne '%RELEASE_NOTES%' .github/release_template.md | sed 's/:.*//')
|
|
head -n $((TOKEN_LINE - 1)) .github/release_template.md > release_body.md
|
|
CHANGELOG_LINES=$(wc -l <docs/changelogs/${{ steps.gettag.outputs.name }}-github.txt)
|
|
tail -n $((CHANGELOG_LINES - 3)) docs/changelogs/${{ steps.gettag.outputs.name }}-github.txt >> release_body.md
|
|
tail -n 2 .github/release_template.md >> release_body.md
|
|
cat release_body.md
|
|
- name: Stage release
|
|
uses: actions/download-artifact@v3
|
|
- name: Create win64 release archive
|
|
run: |
|
|
cd dfhack-windows64-build
|
|
zip -r ../dfhack-${{ steps.gettag.outputs.name }}-Windows-64bit.zip .
|
|
- name: Create linux64 release archive
|
|
run: |
|
|
cd dfhack-linux64-build
|
|
tar cjf ../dfhack-${{ steps.gettag.outputs.name }}-Linux-64bit.tar.bz2 .
|
|
- name: Create or update GitHub release
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
artifacts: "dfhack-*"
|
|
bodyFile: "release_body.md"
|
|
allowUpdates: true
|
|
artifactErrorsFailBuild: true
|
|
draft: true
|
|
name: "DFHack ${{ steps.gettag.outputs.name }}"
|
|
omitBodyDuringUpdate: true
|
|
omitDraftDuringUpdate: true
|
|
omitNameDuringUpdate: true
|
|
omitPrereleaseDuringUpdate: true
|
|
replacesArtifacts: true
|
|
tag: ${{ steps.gettag.outputs.name }}
|