Skip to content

Commit

Permalink
feat: Build taskwarrior CI against stable
Browse files Browse the repository at this point in the history
  • Loading branch information
RedEtherbloom committed Nov 11, 2024
1 parent 92418bd commit dea372c
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 18 deletions.
44 changes: 44 additions & 0 deletions .github/actions/install-taskwarrior/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 'Install Taskwarrior'
description: 'Builds taskwarrior from the latest stable release and installs it'
inputs:
secret_gh_token:
description: "GH token for downloading the assets"
required: true
runs:
using: "composite"
defaults:
run:
shell: bash
steps:
# This pattern should only match match assets with a [numbers and dots] suffix
- name: Download latest stable taskwarrior release
run: |
gh release download -p "task-[0-9.]*.tar.gz" -R "GothenburgBitFactory/taskwarrior" -D /tmp/download
env:
GH_TOKEN: ${{ inputs.secret_gh_token }}
# Future proofing
- name: Check that we only got one release asset
run: |
if [ $(ls -1 download | wc -l) -ne 1 ]
then
echo "Expected exactly one release asset"
exit 1
else
echo "Got expected number of release assets"
fi
- name: Extract taskwarrior without version number
run: |
cd /tmp/download
find . -name "*.tar.gz" -exec mv {} task.tar.gz \;
tar -xf task.tar.gz --transform='s;^task-[0-9.]*/;task/;'
cd /tmp
mv download/task taskwarrior
rm -rf download
- name: Compile taskwarrior
run: |
cd taskwarrior
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release .
cmake --build build
sudo cmake --install build
cd ..
rm -rf task/
13 changes: 4 additions & 9 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,10 @@ jobs:
override: true
profile: minimal
- run: sudo apt-get update
- name: Compile taskwarrior
run: |
cd /tmp
git clone https://github.com/GothenburgBitFactory/taskwarrior
cd taskwarrior
git checkout v3.0.0
cmake -DCMAKE_BUILD_TYPE=release -DENABLE_SYNC=OFF .
make
sudo make install
- name: 'Install Taskwarrior'
uses: ./.github/actions/install-taskwarrior
with:
secret_gh_token: ${{ secrets.GITHUB_TOKEN }}
- run: |
task --version
- uses: actions/checkout@v4
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,10 @@ jobs:
toolchain: stable
override: true
- run: sudo apt-get update
- name: Compile taskwarrior
run: |
cd /tmp
git clone https://github.com/GothenburgBitFactory/taskwarrior
cd taskwarrior
git checkout v3.0.0
cmake -DCMAKE_BUILD_TYPE=release -DENABLE_SYNC=OFF .
make
sudo make install
- name: 'Install Taskwarrior'
uses: ./.github/actions/install-taskwarrior
with:
secret_gh_token: ${{ secrets.GITHUB_TOKEN }}
- run: |
task --version
- uses: actions/checkout@v4
Expand Down

0 comments on commit dea372c

Please sign in to comment.