;ci: cleanups

This commit is contained in:
Simon Michael 2025-03-05 17:03:15 -10:00
parent d883a74fe0
commit 58c277123e
8 changed files with 58 additions and 97 deletions

View File

@ -1,6 +1,8 @@
# TRIGGER: Runs on any push to binaries-linux-x64-stack branch. Not normally used.
# ACTION: Builds, unit-tests and saves mac x64 static binaries with stack and the default ghc. May not work,
# the cabal-based binaries-linux-x64.yml is normally used instead.
# Alternate binaries-linux workflow, using stack like the others for consistency. May not work.
# Currently the cabal-based binaries-linux-x64.yml is used instead, for cabal testing and for easier static building.
#
# TRIGGER: Runs on any push to binaries-linux-x64-stack branch.
# ACTION: Builds, unit-tests and saves mac x64 static binaries with stack and the default ghc.
name: binaries-linux-x64-stack
on:
@ -119,15 +121,16 @@ jobs:
- name: Gather binaries
run: |
mkdir tmp
cp hledger/shell-completion/hledger-completion.bash hledger/embeddedfiles/*.{1,info} tmp
cd tmp
cp ~/.local/bin/hledger .
cp ~/.local/bin/hledger-ui .
cp ~/.local/bin/hledger-web .
strip hledger
strip hledger-ui
strip hledger-web
tar cvf hledger-mac-x64.tar hledger hledger-ui hledger-web hledger-completion.bash
cp ~/.local/bin/hledger tmp
cp ~/.local/bin/hledger-ui tmp
cp ~/.local/bin/hledger-web tmp
cp hledger/embeddedfiles/*.1 tmp
cp hledger/embeddedfiles/*.info tmp
cp hledger/shell-completion/hledger-completion.bash tmp
strip tmp/hledger
strip tmp/hledger-ui
strip tmp/hledger-web
tar -C tmp cvf hledger-linux-x64.tar hledger hledger-ui hledger-web hledger-completion.bash
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.

View File

@ -72,12 +72,13 @@ jobs:
cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-*/x/hledger/build/hledger/hledger tmp
cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-ui-*/x/hledger-ui/build/hledger-ui/hledger-ui tmp
cp dist-newstyle/build/x86_64-linux/ghc-*/hledger-web-*/x/hledger-web/build/hledger-web/hledger-web tmp
cp hledger/shell-completion/hledger-completion.bash hledger/embeddedfiles/*.1 hledger/embeddedfiles/*.info tmp
cd tmp
strip hledger
strip hledger-ui
strip hledger-web
tar cvf hledger-linux-x64.tar hledger hledger-ui hledger-web hledger-completion.bash
cp hledger/embeddedfiles/*.1 tmp
cp hledger/embeddedfiles/*.info tmp
cp hledger/shell-completion/hledger-completion.bash tmp
strip tmp/hledger
strip tmp/hledger-ui
strip tmp/hledger-web
tar -C tmp cvf hledger-linux-x64.tar hledger hledger-ui hledger-web hledger-completion.bash
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.

View File

@ -157,15 +157,16 @@ jobs:
- name: Gather binaries
run: |
mkdir tmp
cp hledger/shell-completion/hledger-completion.bash hledger/embeddedfiles/*.{1,info} tmp
cd tmp
cp ~/.local/bin/hledger .
cp ~/.local/bin/hledger-ui .
cp ~/.local/bin/hledger-web .
strip hledger
strip hledger-ui
strip hledger-web
tar cvf hledger-mac-arm64.tar hledger hledger-ui hledger-web hledger-completion.bash
cp ~/.local/bin/hledger tmp
cp ~/.local/bin/hledger-ui tmp
cp ~/.local/bin/hledger-web tmp
cp hledger/embeddedfiles/*.1 tmp
cp hledger/embeddedfiles/*.info tmp
cp hledger/shell-completion/hledger-completion.bash tmp
strip tmp/hledger
strip tmp/hledger-ui
strip tmp/hledger-web
tar -C tmp cvf hledger-mac-arm64.tar hledger hledger-ui hledger-web hledger-completion.bash
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.

View File

@ -144,15 +144,16 @@ jobs:
- name: Gather binaries
run: |
mkdir tmp
cp hledger/shell-completion/hledger-completion.bash hledger/embeddedfiles/*.{1,info} tmp
cd tmp
cp ~/.local/bin/hledger .
cp ~/.local/bin/hledger-ui .
cp ~/.local/bin/hledger-web .
strip hledger
strip hledger-ui
strip hledger-web
tar cvf hledger-mac-x64.tar hledger hledger-ui hledger-web hledger-completion.bash
cp ~/.local/bin/hledger tmp
cp ~/.local/bin/hledger-ui tmp
cp ~/.local/bin/hledger-web tmp
cp hledger/embeddedfiles/*.1 tmp
cp hledger/embeddedfiles/*.info tmp
cp hledger/shell-completion/hledger-completion.bash tmp
strip tmp/hledger
strip tmp/hledger-ui
strip tmp/hledger-web
tar -C tmp cvf hledger-mac-x64.tar hledger hledger-ui hledger-web hledger-completion.bash
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.

View File

@ -147,14 +147,15 @@ jobs:
- name: Gather binaries
run: |
mkdir tmp
cp hledger/shell-completion/hledger-completion.bash hledger/embeddedfiles/*.{1,info} tmp
cd tmp
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger.exe .
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger-ui.exe .
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger-web.exe .
strip hledger.exe
strip hledger-ui.exe
strip hledger-web.exe
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger.exe tmp
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger-ui.exe tmp
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger-web.exe tmp
cp hledger/embeddedfiles/*.1 tmp
cp hledger/embeddedfiles/*.info tmp
cp hledger/shell-completion/hledger-completion.bash tmp
strip tmp/hledger.exe
strip tmp/hledger-ui.exe
strip tmp/hledger-web.exe
- name: Create binaries artifact
uses: actions/upload-artifact@v4

View File

@ -1,46 +0,0 @@
# Runs on push of a [0-9]* or r[0-9]* tag (to any branch ?)
# Creates a draft github release.
# See https://github.com/actions/create-release, still pretty rough as of 20200609.
# see also: https://github.com/marketplace/actions/tag-release-on-push-action
name: create release
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
# also: "The action does not seem to work for tags created before the workflow."
on:
push:
tags:
- '[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+-*'
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
# - name: Create Release (actions/create-release)
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
# with:
# tag_name: X.Y
# release_name: X.Y
# body: |
# CHANGE 1; CHANGE 2.
# https://hledger.org/release-notes.html#hledger-X-Y
# draft: true
# prerelease: true
- name: Create Release (softprops/action-gh-release)
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -97,13 +97,6 @@ jobs:
allow_forks: false
path: artifacts
- name: Get artifact from latest successful binaries-mac-x64 run
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
workflow: binaries-mac-x64.yml
allow_forks: false
path: artifacts
- name: Get artifact from latest successful binaries-mac-arm64 run
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
@ -111,6 +104,13 @@ jobs:
allow_forks: false
path: artifacts
- name: Get artifact from latest successful binaries-mac-x64 run
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe
with:
workflow: binaries-mac-x64.yml
allow_forks: false
path: artifacts
- name: Inspect artifacts
shell: bash
run: |