Merge pull request #3635 from myk002/myk_package

factor out release package logic
develop
Myk 2023-08-05 01:18:56 -07:00 committed by GitHub
commit 6bc7d9dae0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 61 additions and 52 deletions

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

@ -12,36 +12,18 @@ on:
required: true required: true
jobs: jobs:
package-win64: package:
name: Build win64 release uses: ./.github/workflows/package.yml
uses: ./.github/workflows/build-windows.yml
with: with:
artifact-name: win64-release
dfhack_ref: ${{ github.event.inputs && github.event.inputs.ref || github.event.ref }} dfhack_ref: ${{ github.event.inputs && github.event.inputs.ref || github.event.ref }}
cache-id: release append-date-and-hash: false
cache-readonly: true cache-readonly: true
stonesense: true
docs: true
launchdf: true launchdf: true
secrets: inherit 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: create-update-release:
name: Draft GitHub release name: Draft GitHub release
needs: needs: package
- package-win64
- package-linux64
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write 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 $((CHANGELOG_LINES - 3)) docs/changelogs/${{ steps.gettag.outputs.name }}-github.txt >> release_body.md
tail -n 2 .github/release_template.md >> release_body.md tail -n 2 .github/release_template.md >> release_body.md
cat release_body.md cat release_body.md
- name: Stage win64 release - name: Stage release
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with:
name: win64-release
path: win64
- name: Create win64 release archive - name: Create win64 release archive
run: | run: |
cd win64 cd dfhack-windows64-build
zip -r ../dfhack-${{ steps.gettag.outputs.name }}-Windows-64bit.zip . 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 - name: Create linux64 release archive
run: | run: |
cd linux64 cd dfhack-linux64-build
tar cjf ../dfhack-${{ steps.gettag.outputs.name }}-Linux-64bit.tar.bz2 . tar cjf ../dfhack-${{ steps.gettag.outputs.name }}-Linux-64bit.tar.bz2 .
- name: Create or update GitHub release - name: Create or update GitHub release
uses: ncipollo/release-action@v1 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