Skip to content

Commit 49f108f

Browse files
committed
feat: update github CI to use github releases for CI
1 parent 388a35d commit 49f108f

File tree

1 file changed

+18
-35
lines changed

1 file changed

+18
-35
lines changed

.github/workflows/create_build.yaml

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Deploy to Cloudflare R2
1+
name: Build and Deploy to GitHub Releases
22

33
on:
44
push:
@@ -29,29 +29,16 @@ jobs:
2929
cd build/macos/Build/Products/Release
3030
zip -r "Socket_Probe.zip" "Socket Probe.app"
3131
32-
- name: Upload macOS build to Cloudflare R2 (using put-object and debug)
32+
- name: Upload macOS build to GitHub Releases
33+
uses: softprops/action-gh-release@v1
34+
with:
35+
tag_name: latest
36+
files: build/macos/Build/Products/Release/Socket_Probe.zip
3337
env:
34-
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
35-
R2_BUCKET_NAME: ${{ secrets.R2_BUCKET_NAME }}
36-
run: |
37-
brew install awscli # Install AWS CLI for macOS
38-
aws configure set aws_access_key_id ${{ secrets.R2_ACCESS_KEY_ID }}
39-
aws configure set aws_secret_access_key ${{ secrets.R2_SECRET_ACCESS_KEY }}
40-
aws configure set default.region auto
41-
42-
# Run the put-object command in debug mode
43-
aws s3api put-object \
44-
--bucket "${{ secrets.R2_BUCKET_NAME }}" \
45-
--key "macos/Socket_Probe.zip" \
46-
--body "build/macos/Build/Products/Release/Socket_Probe.zip" \
47-
--acl public-read \
48-
--endpoint-url "https://pub-6e37860d427d4ca69a176fe1bf8313b6.r2.dev" \
49-
--debug
50-
51-
echo "✅ macOS build uploaded!"
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5239

5340
build-windows:
54-
runs-on: windows-latest # ✅ Use Windows runner for Windows builds
41+
runs-on: windows-latest
5542

5643
steps:
5744
- name: Checkout code
@@ -68,23 +55,19 @@ jobs:
6855
- name: Build Windows app
6956
run: flutter build windows
7057

71-
- name: Upload Windows build to Cloudflare R2
72-
run: |
73-
choco install awscli # ✅ Install AWS CLI for Windows
74-
aws configure set aws_access_key_id ${{ secrets.R2_ACCESS_KEY_ID }}
75-
aws configure set aws_secret_access_key ${{ secrets.R2_SECRET_ACCESS_KEY }}
76-
aws configure set default.region auto
77-
78-
aws s3 cp --endpoint-url=https://$R2_ACCOUNT_ID.r2.cloudflarestorage.com \
79-
build/windows/runner/Release/MyApp.exe s3://${{ secrets.R2_BUCKET_NAME }}/windows/MyApp.exe --acl public-read
80-
81-
echo "✅ Windows build uploaded!"
58+
- name: Upload Windows build to GitHub Releases
59+
uses: softprops/action-gh-release@v1
60+
with:
61+
tag_name: latest
62+
files: build/windows/runner/Release/MyApp.exe
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8265

8366
generate-links:
84-
runs-on: ubuntu-latest # ✅ Use Ubuntu for generating download links
67+
runs-on: ubuntu-latest
8568

8669
steps:
8770
- name: Generate Public Links
8871
run: |
89-
echo "Download macOS App: https://${{ secrets.R2_ACCOUNT_ID }}.r2.dev/${{ secrets.R2_BUCKET_NAME }}/macos/MyApp.dmg"
90-
echo "Download Windows App: https://${{ secrets.R2_ACCOUNT_ID }}.r2.dev/${{ secrets.R2_BUCKET_NAME }}/windows/MyApp.exe"
72+
echo "Download macOS App: https://github.com/${{ github.repository }}/releases/latest/download/Socket_Probe.zip"
73+
echo "Download Windows App: https://github.com/${{ github.repository }}/releases/latest/download/MyApp.exe"

0 commit comments

Comments
 (0)