Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Jan 23, 2024
1 parent c54a61f commit dbc5c4c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,29 @@ jobs:
fi
echo "Building ${{ env.PROJECT}} .deb packages for tag ${{ env.RELEASE_TAG }}"
- name: Checkout code
- name: Checkout packages
uses: actions/checkout@v3

- name: Checkout src code into tmp folder
uses: actions/checkout@v3
with:
repository: SiaFoundation/${{ env.PROJECT }}
ref: ${{ env.RELEASE_TAG }}
path: "tmp"

- name: Build .deb Package
run: |
TAG=${{ env.RELEASE_TAG }}
VERSION=${TAG:1}
# Move into the tmp directory
cd tmp
go generate ./...
for arch in amd64 arm64; do
# Helper vars
TAG=${{ env.RELEASE_TAG }}
VERSION=${TAG:1}
BUILD_NAME=${{ env.PROJECT}}_$VERSION_$arch
BUILD_NAME=${{ env.PROJECT }}_$VERSION_$arch
# Make sure the right folder hierarchy exists for building the package
# Create the directory structure for the .deb package
mkdir -p $BUILD_NAME/DEBIAN
mkdir -p $BUILD_NAME/usr/bin
Expand All @@ -63,17 +70,21 @@ jobs:
echo "Building $BUILD_NAME.deb"
dpkg-deb --build $BUILD_NAME
# Move the .deb file to debian/pool/main/r/${{ env.PROJECT }}
find .
mv $BUILD_NAME.deb debian/pool/main/r/${{ env.PROJECT }}/
# Move the .deb file to debian/pool/main/${{ env.PROJECT }}/
find ../
mv $BUILD_NAME.deb debian/pool/main/${{ env.PROJECT }}/
# Update the Packages file
dpkg-scanpackages debian/pool/main/r/${{ env.PROJECT }}/ /dev/null | gzip -9c > debian/dists/stable/main/binary-$arch/Packages.gz
dpkg-scanpackages debian/pool/main/${{ env.PROJECT }}/ /dev/null | gzip -9c > debian/dists/stable/main/binary-$arch/Packages.gz
# Remove the temporary folders
rm -rf $BUILD_NAME
done
# Move out of tmp and delete it
cd ../
rm -rf src
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
Expand Down

0 comments on commit dbc5c4c

Please sign in to comment.