Skip to content

Commit

Permalink
fix: ci workflow (#2)
Browse files Browse the repository at this point in the history
* fix: use ar to extract data from deb file

* fix(ci): ignore build version during test
  • Loading branch information
reubenmiller authored Jul 25, 2023
1 parent 5371e05 commit e9aed1d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: test
permissions:
contents: write
on:
pull_request:
workflow_dispatch:
jobs:
release:
name: Package and release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: extractions/setup-just@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-go@v3
with:
go-version: '>=1.20.0'
- run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
name: Install dependencies

- name: Package
run: just build
9 changes: 6 additions & 3 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@ build() {

# create tarball (use deb file as the reference)
echo "using tarball packager..."
DEB_FILE=$(ls "$output_dir/${PACKAGE_NAME}"_*.deb)
DEB_FILE=$(find "$output_dir" -name "${PACKAGE_NAME}*.deb" | head -1)
if [ -z "$DEB_FILE" ]; then
echo "WARNING: Could not find the debian file. dir=$output_dir" >&2
fi

TARBALL="$(echo "${DEB_FILE%.*}.tar.gz" | sed 's/_all//g' )"
tar xvzf "$DEB_FILE" data.tar.gz >/dev/null 2>&1
TARBALL="$(echo "${DEB_FILE%.*}.tar.gz" | sed 's/_all//g')"
ar x "$DEB_FILE" data.tar.gz
mv data.tar.gz "$TARBALL"
echo "created tarball: $TARBALL"
}
Expand Down

0 comments on commit e9aed1d

Please sign in to comment.