factor out release package logic

develop
Myk Taylor 2023-08-05 00:58:09 -07:00
parent 9552d145b6
commit 6357aa2419
No known key found for this signature in database
3 changed files with 61 additions and 52 deletions

@ -7,26 +7,10 @@ jobs:
uses: ./.github/workflows/test.yml
secrets: inherit
package-linux:
name: Linux package
uses: ./.github/workflows/build-linux.yml
with:
artifact-name: dfhack-linux64-build
append-date-and-hash: true
cache-id: release
stonesense: true
docs: true
secrets: inherit
package-win64:
name: Win64 package
uses: ./.github/workflows/build-windows.yml
package:
uses: ./.github/workflows/package.yml
with:
artifact-name: dfhack-win64-build
append-date-and-hash: true
cache-id: release
stonesense: true
docs: true
dfhack_ref: ${{ github.ref }}
secrets: inherit
docs:

@ -12,36 +12,18 @@ on:
required: true
jobs:
package-win64:
name: Build win64 release
uses: ./.github/workflows/build-windows.yml
package:
uses: ./.github/workflows/package.yml
with:
artifact-name: win64-release
dfhack_ref: ${{ github.event.inputs && github.event.inputs.ref || github.event.ref }}
cache-id: release
append-date-and-hash: false
cache-readonly: true
stonesense: true
docs: true
launchdf: true
secrets: inherit
package-linux64:
name: Build linux64 release
uses: ./.github/workflows/build-linux.yml
with:
artifact-name: linux64-release
dfhack_ref: ${{ github.event.inputs && github.event.inputs.ref || github.event.ref }}
cache-id: release
cache-readonly: true
stonesense: true
docs: true
secrets: inherit
create-update-release:
name: Draft GitHub release
needs:
- package-win64
- package-linux64
needs: package
runs-on: ubuntu-latest
permissions:
contents: write
@ -63,23 +45,15 @@ jobs:
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 win64 release
- name: Stage release
uses: actions/download-artifact@v3
with:
name: win64-release
path: win64
- name: Create win64 release archive
run: |
cd win64
cd dfhack-windows64-build
zip -r ../dfhack-${{ steps.gettag.outputs.name }}-Windows-64bit.zip .
- name: Stage linux64 release
uses: actions/download-artifact@v3
with:
name: linux64-release
path: linux64
- name: Create linux64 release archive
run: |
cd linux64
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

@ -0,0 +1,51 @@
name: Package
on:
workflow_call:
inputs:
dfhack_ref:
type: string
scripts_ref:
type: string
structures_ref:
type: string
append-date-and-hash:
type: boolean
default: true
cache-readonly:
type: boolean
default: false
launchdf:
type: boolean
default: false
jobs:
package-win64:
name: Windows
uses: ./.github/workflows/build-windows.yml
with:
dfhack_ref: ${{ inputs.dfhack_ref }}
scripts_ref: ${{ inputs.scripts_ref }}
structures_ref: ${{ inputs.structures_ref }}
artifact-name: dfhack-windows64-build
append-date-and-hash: ${{ inputs.append-date-and-hash }}
cache-id: release
cache-readonly: ${{ inputs.cache-readonly }}
stonesense: true
docs: true
secrets: inherit
package-linux:
name: Linux
uses: ./.github/workflows/build-linux.yml
with:
dfhack_ref: ${{ inputs.dfhack_ref }}
scripts_ref: ${{ inputs.scripts_ref }}
structures_ref: ${{ inputs.structures_ref }}
artifact-name: dfhack-linux64-build
append-date-and-hash: ${{ inputs.append-date-and-hash }}
cache-id: release
cache-readonly: ${{ inputs.cache-readonly }}
stonesense: true
docs: true
secrets: inherit