2024-06-09 17:52:06 +00:00
|
|
|
name: Build artifacts and make release
|
2024-06-09 12:18:56 +00:00
|
|
|
|
2024-06-09 17:52:06 +00:00
|
|
|
on: workflow_dispatch
|
2024-06-09 12:18:56 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-windows:
|
|
|
|
runs-on:
|
|
|
|
- ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
2024-06-09 12:50:38 +00:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Cache Docker layers
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: /tmp/.buildx-cache
|
|
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-buildx-
|
2024-06-09 13:25:54 +00:00
|
|
|
# - name: Cache pip packages
|
|
|
|
# id: pip-cache
|
|
|
|
# uses: actions/cache@v4
|
|
|
|
# with:
|
|
|
|
# path: /tmp/cachepip
|
|
|
|
# key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
|
|
|
|
# restore-keys: |
|
|
|
|
# ${{ runner.os }}-pip-
|
2024-06-09 12:50:38 +00:00
|
|
|
- name: Run Docker Container
|
2024-06-09 12:18:56 +00:00
|
|
|
run: |
|
2024-06-09 12:50:38 +00:00
|
|
|
docker run --rm \
|
2024-06-09 12:53:23 +00:00
|
|
|
--volume "${{ github.workspace }}:/src/" \
|
2024-06-09 17:52:06 +00:00
|
|
|
--env SPECFILE=./BTClockOTA.spec \
|
2024-06-09 13:29:04 +00:00
|
|
|
batonogov/pyinstaller-windows:latest
|
2024-06-09 17:52:06 +00:00
|
|
|
- name: Get current block
|
|
|
|
id: getBlockHeight
|
|
|
|
run: echo "blockHeight=$(curl -s https://mempool.space/api/blocks/tip/height)" >> $GITHUB_OUTPUT
|
2024-06-09 12:18:56 +00:00
|
|
|
- name: Archive artifacts
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: windows-artifacts
|
|
|
|
path: dist/
|
2024-06-09 17:52:06 +00:00
|
|
|
- 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
|