Improve workflow

This commit is contained in:
Djuri Baars 2024-06-10 00:56:42 +02:00
parent 9b04535f24
commit 1898bec5bb
3 changed files with 63 additions and 25 deletions

38
.github/workflows/build_all.yaml vendored Normal file
View file

@ -0,0 +1,38 @@
name: Build all artifacts and make release
on: workflow_dispatch
jobs:
prepare:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Get current block
id: getBlockHeight
run: echo "blockHeight=$(curl -s https://mempool.space/api/blocks/tip/height)" >> $GITHUB_OUTPUT
- name: Build Windows
uses: ./.github/workflows/build_windows
- name: Build macOS
uses: ./.github/workflows/build_macos
- name: Get Windows Artifacts
if: ${{ always() }}
uses: actions/download-artifact@v4
with:
name: windows-artifacts
path: windows
- name: Get Job 1 Artifacts
if: ${{ always() }}
uses: actions/download-artifact@v4
with:
name: macos-artifacts
path: macos
- name: Create release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.getBlockHeight.outputs.blockHeight }}
commit: main
name: release-${{ steps.getBlockHeight.outputs.blockHeight }}
artifacts: "macos/**/*.dmg,macos/**/*.zip,windows/**/*.exe"
allowUpdates: true
makeLatest: true

View file

@ -34,9 +34,9 @@ jobs:
- name: Build with PyInstaller
run: |
pyinstaller BTClockOTA-universal.spec
- name: Get current block
id: getBlockHeight
run: echo "blockHeight=$(curl -s https://mempool.space/api/blocks/tip/height)" >> $GITHUB_OUTPUT
# - name: Get current block
# id: getBlockHeight
# run: echo "blockHeight=$(curl -s https://mempool.space/api/blocks/tip/height)" >> $GITHUB_OUTPUT
- name: Zip the app bundle
run: |
cd dist
@ -54,12 +54,12 @@ jobs:
path: |
dist/*
!dist/BTClockOTA.app
- name: Create release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.getBlockHeight.outputs.blockHeight }}
commit: main
name: release-${{ steps.getBlockHeight.outputs.blockHeight }}
artifacts: "dist/*.dmg,dist/*.zip"
allowUpdates: true
makeLatest: true
# - name: Create release
# uses: ncipollo/release-action@v1
# with:
# tag: ${{ steps.getBlockHeight.outputs.blockHeight }}
# commit: main
# name: release-${{ steps.getBlockHeight.outputs.blockHeight }}
# artifacts: "dist/*.dmg,dist/*.zip"
# allowUpdates: true
# makeLatest: true

View file

@ -34,21 +34,21 @@ jobs:
--volume "${{ github.workspace }}:/src/" \
--env SPECFILE=./BTClockOTA.spec \
batonogov/pyinstaller-windows:latest
- name: Get current block
id: getBlockHeight
run: echo "blockHeight=$(curl -s https://mempool.space/api/blocks/tip/height)" >> $GITHUB_OUTPUT
# - name: Get current block
# id: getBlockHeight
# run: echo "blockHeight=$(curl -s https://mempool.space/api/blocks/tip/height)" >> $GITHUB_OUTPUT
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: windows-artifacts
path: dist/
- name: Create release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.getBlockHeight.outputs.blockHeight }}
commit: main
name: release-${{ steps.getBlockHeight.outputs.blockHeight }}
artifacts: 'dist/**'
allowUpdates: true
removeArtifacts: true
makeLatest: true
# - name: Create release
# uses: ncipollo/release-action@v1
# with:
# tag: ${{ steps.getBlockHeight.outputs.blockHeight }}
# commit: main
# name: release-${{ steps.getBlockHeight.outputs.blockHeight }}
# artifacts: 'dist/**'
# allowUpdates: true
# removeArtifacts: true
# makeLatest: true