Skip to content

Commit

Permalink
Fix broken Windows release package builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart Feenstra committed Jul 12, 2021
1 parent 8ac9c18 commit c937294
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
37 changes: 27 additions & 10 deletions .github/workflows/publish-windows-exe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
- master-dev
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.x-dev'
workflow_run:
workflows:
- Tag development releases
type:
- complete

jobs:
build:
Expand All @@ -14,37 +19,49 @@ jobs:
- name: Check out the source code
uses: actions/checkout@v2

- name: Determine the tag for branch builds
if: startsWith(github.ref, 'refs/heads/')
run: echo "betty_tag=$(git rev-parse --abbrev-ref HEAD)-dev" >> $GITHUB_ENV
shell: bash

- name: Determine the tag for tag builds
if: startsWith(github.ref, 'refs/tags/')
run: echo "betty_tag=$(echo '{{ github.ref }}' | awk '{print substr($1,11)}')" >> $GITHUB_ENV
shell: bash

- name: Debug the tag
run: echo ${{ env.betty_tag }}
shell: bash

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Build the development environment
run: |
./bin/build-dev
run: ./bin/build-dev
shell: bash

- name: Get the pip cache directory path
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
run: echo "::set-output name=dir::$(pip cache dir)"
shell: bash

- name: Cache the pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
restore-keys: ${{ runner.os }}-pip-

- name: Build the executable
run: |
./bin/build-pyinstaller
run: ./bin/build-pyinstaller
shell: bash

- name: Publish the executable
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
files: ./dist/betty.exe
tag_name: 9.9.9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 7 additions & 3 deletions .github/workflows/tag-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches:
- master
- '[0-9].[0-9].x'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
Expand All @@ -16,5 +14,11 @@ jobs:
- name: Check out the source code
uses: actions/checkout@v2

- name: Determine the tag
run: echo "betty_tag=$(git rev-parse --abbrev-ref HEAD)-dev" >> $GITHUB_ENV

- name: Tag the development release
run: git tag ${{ env.betty_tag }}

- name: Push the tag
run: 'curl -X POST -H "Authorization: token ${{ secrets.PAT }}" -d "{\"ref\": \"refs/tags/$(git rev-parse --abbrev-ref HEAD)-dev\",\"sha\": \"$(git rev-parse HEAD)\"}" https://api.github.com/repos/bartfeenstra/betty/git/refs'
run: git push --force origin ${{ env.betty_tag }}

0 comments on commit c937294

Please sign in to comment.