@@ -8,82 +8,82 @@ permissions:
88 contents : write # Required to upload release assets
99
1010jobs :
11- # build_and_upload_image:
12- # runs-on: ubuntu-22.04-arm
13- # steps:
14- # - name: "Checkout code"
15- # uses: actions/checkout@v4
16-
17- # - name: "Set up Python"
18- # uses: actions/setup-python@v5
19- # with:
20- # python-version: '3.10'
21-
22- # - name: "Set up Node.js"
23- # uses: actions/setup-node@v3
24- # with:
25- # node-version: '22'
26- # - name: "Install Dependencies"
27- # run: |
28- # echo "Installing dependencies..."
29- # ./install_requirements.sh
30-
31- # - name: "Run Create Release Script"
32- # run: |
33- # echo "Creating release..."
34- # chmod +x ./create_release.sh
35- # pip install requests
36- # # Pass the release name to the script
37- # ./create_release.sh << ${{ github.event.release.name }}
38- # - name: "Upload release"
39- # uses: actions/upload-release-asset@v1
40- # with:
41- # upload_url: ${{ github.event.release.upload_url }}
42- # asset_path: release.tar.gz
43- # asset_name: release.tar.gz
44- # asset_content_type: application/gzip
45- # env:
46- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
48- # - name: "Checkout Pi Image Repository"
49- # uses: actions/checkout@v4
50- # with:
51- # repository: DeepWaterExploration/pi-gen
52- # path: pi-gen
53- # - name: "Install Dependencies for Pi Image Build"
54- # run: |
55- # echo "Installing dependencies..."
56- # sudo apt-get install coreutils quilt parted qemu-user-static debootstrap zerofree zip \
57- # dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file git curl bc \
58- # gpg pigz xxd arch-test
59-
60- # - name: "Build Pi Image"
61- # run: |
62- # echo "Building Pi Image..."
63- # cd pi-gen
64- # echo "" >> ./config
65- # echo "export DWE_VERSION=\"${{ github.event.release.name }}\"" >> ./config
66- # echo "" >> ./config
67- # sudo ./build.sh -c ./config
68-
69- # - name: "Fix Permissions of Deploy Directory"
70- # run: sudo chown -R runner:runner pi-gen/deploy
71-
72- # - name: "Find Pi Image File"
73- # id: find_image
74- # run: |
75- # IMAGE_FILE=$(find pi-gen/deploy -name "*.zip" | head -1)
76- # echo "image_file=$IMAGE_FILE" >> $GITHUB_OUTPUT
77-
78- # - name: "Upload Pi Image to Release"
79- # uses: actions/upload-release-asset@v1
80- # with:
81- # upload_url: ${{ github.event.release.upload_url }}
82- # asset_path: ${{ steps.find_image.outputs.image_file }}
83- # asset_name: DWE_OS_${{ github.event.release.name }}.zip
84- # asset_content_type: application/zip
85- # env:
86- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+ build_and_upload_image :
12+ runs-on : ubuntu-22.04-arm
13+ steps :
14+ - name : " Checkout code"
15+ uses : actions/checkout@v4
16+
17+ - name : " Set up Python"
18+ uses : actions/setup-python@v5
19+ with :
20+ python-version : ' 3.10'
21+
22+ - name : " Set up Node.js"
23+ uses : actions/setup-node@v3
24+ with :
25+ node-version : ' 22'
26+ - name : " Install Dependencies"
27+ run : |
28+ echo "Installing dependencies..."
29+ ./install_requirements.sh
30+
31+ - name : " Run Create Release Script"
32+ run : |
33+ echo "Creating release..."
34+ chmod +x ./create_release.sh
35+ pip install requests
36+ # Pass the release name to the script
37+ ./create_release.sh << ${{ github.event.release.name }}
38+ - name : " Upload release"
39+ uses : actions/upload-release-asset@v1
40+ with :
41+ upload_url : ${{ github.event.release.upload_url }}
42+ asset_path : release.tar.gz
43+ asset_name : release.tar.gz
44+ asset_content_type : application/gzip
45+ env :
46+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
47+
48+ - name : " Checkout Pi Image Repository"
49+ uses : actions/checkout@v4
50+ with :
51+ repository : DeepWaterExploration/pi-gen
52+ path : pi-gen
53+ - name : " Install Dependencies for Pi Image Build"
54+ run : |
55+ echo "Installing dependencies..."
56+ sudo apt-get install coreutils quilt parted qemu-user-static debootstrap zerofree zip \
57+ dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file git curl bc \
58+ gpg pigz xxd arch-test
59+
60+ - name : " Build Pi Image"
61+ run : |
62+ echo "Building Pi Image..."
63+ cd pi-gen
64+ echo "" >> ./config
65+ echo "export DWE_VERSION=\"${{ github.event.release.name }}\"" >> ./config
66+ echo "" >> ./config
67+ sudo ./build.sh -c ./config
68+
69+ - name : " Fix Permissions of Deploy Directory"
70+ run : sudo chown -R runner:runner pi-gen/deploy
71+
72+ - name : " Find Pi Image File"
73+ id : find_image
74+ run : |
75+ IMAGE_FILE=$(find pi-gen/deploy -name "*.zip" | head -1)
76+ echo "image_file=$IMAGE_FILE" >> $GITHUB_OUTPUT
77+
78+ - name : " Upload Pi Image to Release"
79+ uses : actions/upload-release-asset@v1
80+ with :
81+ upload_url : ${{ github.event.release.upload_url }}
82+ asset_path : ${{ steps.find_image.outputs.image_file }}
83+ asset_name : DWE_OS_${{ github.event.release.name }}.zip
84+ asset_content_type : application/zip
85+ env :
86+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8787
8888 build_docker_image :
8989 runs-on : ubuntu-22.04-arm
@@ -110,11 +110,4 @@ jobs:
110110 - name : " Build Docker Image"
111111 run : |
112112 echo "Building Docker Image..."
113- sudo docker buildx build --platform linux/arm/v7 -t deepwaterexploration/dwe_os_2 --load -f docker/Dockerfile .
114- docker tag deepwaterexploration/dwe_os_2 deepwaterexploration/dwe_os_2:${{ github.event.release.name }}
115-
116- - name : " Push Docker Image"
117- run : |
118- echo "Pushing Docker Image..."
119- docker push deepwaterexploration/dwe_os_2:${{ github.event.release.name }}
120- docker push deepwaterexploration/dwe_os_2:latest
113+ docker buildx build --platform linux/arm/v7 -t deepwaterexploration/dwe_os_2:${{ github.event.release.name }} --push -f docker/Dockerfile .
0 commit comments