-
Notifications
You must be signed in to change notification settings - Fork 102
41 lines (34 loc) · 1.03 KB
/
release_windows.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Build and upload release (windows)
on:
release:
types: [created]
env:
APP_NAME: gdrive
ARCHIVE_NAME: gdrive_windows-x64.zip
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare upload url
run: |
UPLOAD_URL="$(jq -r '.release.upload_url' "$GITHUB_EVENT_PATH" | sed -e "s/{?name,label}$/?name=${ARCHIVE_NAME}/")"
echo "UPLOAD_URL=$UPLOAD_URL" >> $GITHUB_ENV
shell: bash
- name: Build application
run: |
cargo build --release
cd target/release
7z a -tzip $ARCHIVE_NAME $APP_NAME
mv $ARCHIVE_NAME ../../
shell: bash
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ${{ env.ARCHIVE_NAME }}
asset_name: ${{ env.ARCHIVE_NAME }}
asset_content_type: application/zip