Skip to content

Commit a28ff8d

Browse files
committed
Fix workflows
1 parent 17e9be5 commit a28ff8d

File tree

2 files changed

+43
-10
lines changed

2 files changed

+43
-10
lines changed

.github/workflows/cargo-test.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ jobs:
4040
uses: actions-rs/cargo@v1
4141
with:
4242
command: xtest
43-
args: --verbose

.github/workflows/release.yaml

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,13 @@ jobs:
5858
fi
5959
6060
- name: Upload artifact
61-
uses: actions/upload-artifact@v3
61+
uses: actions/upload-artifact@v4
6262
with:
6363
name: ${{ matrix.asset_name }}
6464
path: dist/${{ matrix.asset_name }}
6565
retention-days: 1
6666
if-no-files-found: error
67+
compression-level: 0
6768

6869
release:
6970
needs: build
@@ -72,9 +73,14 @@ jobs:
7273
steps:
7374
- name: Checkout code
7475
uses: actions/checkout@v3
76+
77+
- name: Install dependencies
78+
run: |
79+
sudo apt-get update
80+
sudo apt-get install -y jq
7581
7682
- name: Download artifacts
77-
uses: actions/download-artifact@v3
83+
uses: actions/download-artifact@v4
7884
with:
7985
path: dist
8086

@@ -103,11 +109,39 @@ jobs:
103109
104110
- name: Create release
105111
id: create_release
106-
uses: softprops/action-gh-release@v1
107-
with:
108-
files: release_files/*
109-
draft: false
110-
prerelease: false
111-
generate_release_notes: true
112112
env:
113-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
run: |
115+
# Extract version from tag
116+
VERSION=${GITHUB_REF#refs/tags/}
117+
echo "Creating release for $VERSION"
118+
119+
# Create the release
120+
RELEASE_RESPONSE=$(curl -s -X POST \
121+
-H "Authorization: token $GITHUB_TOKEN" \
122+
-H "Accept: application/vnd.github.v3+json" \
123+
https://api.github.com/repos/${{ github.repository }}/releases \
124+
-d '{
125+
"tag_name": "'$VERSION'",
126+
"name": "AIScript '$VERSION'",
127+
"body": "Release of AIScript '$VERSION'",
128+
"draft": false,
129+
"prerelease": false,
130+
"generate_release_notes": true
131+
}')
132+
133+
RELEASE_ID=$(echo $RELEASE_RESPONSE | jq -r .id)
134+
echo "Created release with ID: $RELEASE_ID"
135+
echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV
136+
137+
# Upload assets
138+
for ASSET in release_files/*; do
139+
ASSET_NAME=$(basename $ASSET)
140+
echo "Uploading $ASSET_NAME..."
141+
curl -s -X POST \
142+
-H "Authorization: token $GITHUB_TOKEN" \
143+
-H "Accept: application/vnd.github.v3+json" \
144+
-H "Content-Type: application/octet-stream" \
145+
--data-binary @$ASSET \
146+
"https://uploads.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID/assets?name=$ASSET_NAME"
147+
done

0 commit comments

Comments
 (0)