@@ -862,12 +862,6 @@ jobs:
862
862
echo "Using version: $(cat $GITHUB_OUTPUT | grep VERSION | cut -d= -f2)"
863
863
echo "VERSION=$(cat $GITHUB_OUTPUT | grep VERSION | cut -d= -f2)" >> $GITHUB_ENV
864
864
865
- - name : Install Snapcraft
866
- run : |
867
- sudo snap install snapcraft --classic
868
- sudo apt-get update
869
- sudo apt-get install -y curl jq
870
-
871
865
- name : Download Linux binary
872
866
873
867
with :
@@ -879,52 +873,28 @@ jobs:
879
873
880
874
- name : Create Snap directory structure
881
875
run : |
882
- mkdir -p apisnip/ snap/local/
883
- mkdir -p apisnip/meta/gui
876
+ mkdir -p snap-build/bin
877
+ mkdir -p snap-build/snap
884
878
885
879
# Extract binary
886
- mkdir -p apisnip/bin
887
- tar -xzf ./downloaded/apisnip-linux-x86_64.tar.gz -C apisnip
880
+ tar -xzf ./downloaded/apisnip-linux-x86_64.tar.gz -C snap-build
888
881
889
882
# Move binary to the right place
890
- if [ -f "apisnip /apisnip" ]; then
891
- mv apisnip /apisnip apisnip /bin/
892
- elif [ -f "apisnip /usr/bin/apisnip" ]; then
893
- mkdir -p apisnip /bin
894
- mv apisnip /usr/bin/apisnip apisnip /bin/
883
+ if [ -f "snap-build /apisnip" ]; then
884
+ mv snap-build /apisnip snap-build /bin/
885
+ elif [ -f "snap-build /usr/bin/apisnip" ]; then
886
+ mkdir -p snap-build /bin
887
+ mv snap-build /usr/bin/apisnip snap-build /bin/
895
888
fi
896
889
897
890
# Ensure binary is executable
898
- chmod +x apisnip/bin/apisnip
899
-
900
- # Create snap.yaml
901
- cat > apisnip/meta/snap.yaml << EOF
902
- name: apisnip
903
- version: ${{ env.VERSION }}
904
- summary: A terminal user interface (TUI) tool for trimming OpenAPI specifications
905
- description: |
906
- ApiSnip is a command-line tool that helps you trim down large OpenAPI specifications
907
- to only the parts you need. It provides a user-friendly terminal interface for
908
- selecting specific endpoints and data models.
909
-
910
- grade: stable
911
- confinement: strict
912
- base: core20
913
-
914
- apps:
915
- apisnip:
916
- command: bin/apisnip
917
- plugs:
918
- - home
919
- - network
920
- - network-bind
921
- EOF
891
+ chmod +x snap-build/bin/apisnip
922
892
923
- # Create snapcraft.yaml
924
- cat > apisnip /snap/snapcraft.yaml << EOF
893
+ # Create snapcraft.yaml in snap/ directory
894
+ cat > snap-build /snap/snapcraft.yaml << EOF
925
895
name: apisnip
926
896
version: ${{ env.VERSION }}
927
- summary: A terminal user interface (TUI) tool for trimming OpenAPI specifications
897
+ summary: A terminal user interface tool for trimming OpenAPI specifications
928
898
description: |
929
899
ApiSnip is a command-line tool that helps you trim down large OpenAPI specifications
930
900
to only the parts you need. It provides a user-friendly terminal interface for
@@ -951,25 +921,23 @@ jobs:
951
921
- network-bind
952
922
EOF
953
923
954
- - name : Build Snap package
924
+ - name : Build Snap package using Docker
955
925
id : build_snap
956
926
run : |
957
- cd apisnip
958
- snapcraft
927
+ # Use Docker snapcraft image instead of multipass
928
+ docker run --rm -v $(pwd)/snap-build:/build -w /build snapcore/snapcraft:stable snapcraft
959
929
960
930
# Find the snap file
961
- SNAP_FILE=$(find . -name "*.snap" | head -1)
931
+ SNAP_FILE=$(find snap-build -name "*.snap" | head -1)
962
932
if [ -z "$SNAP_FILE" ]; then
963
933
echo "Error: No snap file found"
964
934
exit 1
965
935
fi
966
936
967
- # Copy snap file to workspace root
968
- cp "$SNAP_FILE" ../
969
- cd ..
970
-
971
937
# Get the filename
972
938
SNAP_FILENAME=$(basename "$SNAP_FILE")
939
+ cp "$SNAP_FILE" ./
940
+
973
941
echo "SNAP_FILENAME=$SNAP_FILENAME" >> $GITHUB_OUTPUT
974
942
975
943
# Create checksum
0 commit comments