Skip to content

Commit 9040f22

Browse files
committed
Add composite action for uploading
1 parent e5bda06 commit 9040f22

File tree

3 files changed

+38
-10
lines changed

3 files changed

+38
-10
lines changed

.github/workflows/actions/upload.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Upload binary file"
2+
description: "Upload binary file to GitHub releases"
3+
inputs:
4+
repo-token:
5+
required: true
6+
description: "The secret created for the workflow run"
7+
file-name:
8+
required: true
9+
description: "The file name to be uploaded"
10+
tag:
11+
required: false
12+
description: "The short ref name of the branch or tag that triggered the workflow run."
13+
default: ${{ github.ref_name }}
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Upload binary
18+
uses: svenstaro/upload-release-action@v2
19+
with:
20+
repo_token: ${{ inputs.repo-token }}
21+
overwrite: true
22+
file: ${{ inputs.file-name }}
23+
asset_name: ${{ inputs.file-name }}
24+
tag: ${{ inputs.tag }}

.github/workflows/linux.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ jobs:
2424

2525
- name: Upload binary
2626
if: github.event_name == 'workflow_dispatch'
27-
uses: svenstaro/upload-release-action@v2
27+
uses: ./.github/actions/upload
2828
with:
29-
repo_token: ${{ secrets.GITHUB_TOKEN }}
30-
overwrite: true
31-
file: libpowersync_x64.so
32-
asset_name: libpowersync_x64.so
29+
repo-token: ${{ secrets.GITHUB_TOKEN }}
30+
file-name: libpowersync_x64.so
3331
tag: ${{ github.ref_name }}
3432

3533
build_aarch64:
@@ -51,10 +49,8 @@ jobs:
5149

5250
- name: Upload binary
5351
if: github.event_name == 'workflow_dispatch'
54-
uses: svenstaro/upload-release-action@v2
52+
uses: ./.github/actions/upload
5553
with:
56-
repo_token: ${{ secrets.GITHUB_TOKEN }}
57-
overwrite: true
58-
file: libpowersync_aarch64.so
59-
asset_name: libpowersync_aarch64.so
54+
repo-token: ${{ secrets.GITHUB_TOKEN }}
55+
file-name: libpowersync_aarch64.so
6056
tag: ${{ github.ref_name }}

.github/workflows/windows.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@ jobs:
1414

1515
- name: Build binary
1616
run: bash tool/build_windows.sh x64
17+
18+
- name: Upload binary
19+
if: github.event_name == 'workflow_dispatch'
20+
uses: ./.github/actions/upload
21+
with:
22+
repo-token: ${{ secrets.GITHUB_TOKEN }}
23+
file-name: powersync_x64.so
24+
tag: ${{ github.ref_name }}

0 commit comments

Comments
 (0)