Skip to content

Commit 9958fbe

Browse files
committed
Make publishing optional.
1 parent 3c36654 commit 9958fbe

File tree

4 files changed

+38
-32
lines changed

4 files changed

+38
-32
lines changed

.github/actions/upload/action.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ runs:
1515
using: "composite"
1616
steps:
1717
- 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 }}
18+
shell: bash
19+
env:
20+
GH_TOKEN: ${{ github.token }}
21+
GH_REPO: ${{ github.repository }}
22+
run: |
23+
gh release upload "${{ inputs.tag }}" "${{ inputs.file-name }}"

.github/workflows/linux.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
on:
22
push:
3-
workflow_dispatch:
43
name: "linux"
54
jobs:
65
build_x86_64:
@@ -20,14 +19,6 @@ jobs:
2019
- name: Build binaries
2120
run: ./tool/build_linux.sh x64
2221

23-
- name: Upload binary
24-
if: github.event_name == 'workflow_dispatch'
25-
uses: ./.github/actions/upload
26-
with:
27-
repo-token: ${{ secrets.GITHUB_TOKEN }}
28-
file-name: libpowersync_x64.so
29-
tag: ${{ github.ref_name }}
30-
3122
build_aarch64:
3223
name: Building Linux aarch64
3324
runs-on: ubuntu-arm64
@@ -44,11 +35,3 @@ jobs:
4435

4536
- name: Build binaries
4637
run: ./tool/build_linux.sh aarch64
47-
48-
- name: Upload binary
49-
if: github.event_name == 'workflow_dispatch'
50-
uses: ./.github/actions/upload
51-
with:
52-
repo-token: ${{ secrets.GITHUB_TOKEN }}
53-
file-name: libpowersync_aarch64.so
54-
tag: ${{ github.ref_name }}

.github/workflows/release.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
name: release
22
on:
33
workflow_dispatch:
4-
push:
4+
inputs:
5+
publish:
6+
type: boolean
7+
required: false
8+
default: false
9+
description: Set to true to publish artifacts to external targets such as Maven Central
510
jobs:
611
draft_release:
712
if: github.event_name == 'workflow_dispatch'
@@ -57,6 +62,7 @@ jobs:
5762
cargo install cargo-ndk
5863
5964
- name: Publish for Android
65+
if: ${{ inputs.publish }}
6066
run: |
6167
cd android
6268
./gradlew publish
@@ -123,7 +129,7 @@ jobs:
123129
components: rust-src
124130

125131
- name: Build binaries
126-
run: bash tool/build_linux.sh x64
132+
run: ./tool/build_linux.sh x64
127133

128134
- name: Upload binary
129135
uses: ./.github/actions/upload
@@ -135,7 +141,7 @@ jobs:
135141
publish_linux_aarch64:
136142
name: Publish Linux aarch64
137143
needs: [draft_release]
138-
runs-on: ubuntu-latest
144+
runs-on: ubuntu-arm64
139145
steps:
140146
- uses: actions/checkout@v3
141147
with:
@@ -148,7 +154,7 @@ jobs:
148154
components: rust-src
149155

150156
- name: Build binaries
151-
run: bash tool/build_linux.sh aarch64
157+
run: ./tool/build_linux.sh aarch64
152158

153159
- name: Upload binary
154160
uses: ./.github/actions/upload
@@ -166,8 +172,14 @@ jobs:
166172
with:
167173
submodules: true
168174

175+
- name: Install Rust Nightly
176+
uses: dtolnay/rust-toolchain@stable
177+
with:
178+
toolchain: nightly-2024-05-18
179+
components: rust-src
180+
169181
- name: Build binary
170-
run: bash tool/build_windows.sh x64
182+
run: ./tool/build_windows.sh x64
171183

172184
- name: Upload binary
173185
uses: ./.github/actions/upload
@@ -185,8 +197,14 @@ jobs:
185197
with:
186198
submodules: true
187199

200+
- name: Install Rust Nightly
201+
uses: dtolnay/rust-toolchain@stable
202+
with:
203+
toolchain: nightly-2024-05-18
204+
components: rust-src
205+
188206
- name: Build binary
189-
run: bash tool/build_macos.sh aarch64
207+
run: ./tool/build_macos.sh aarch64
190208

191209
- name: Upload binary
192210
uses: ./.github/actions/upload
@@ -204,8 +222,14 @@ jobs:
204222
with:
205223
submodules: true
206224

225+
- name: Install Rust Nightly
226+
uses: dtolnay/rust-toolchain@stable
227+
with:
228+
toolchain: nightly-2024-05-18
229+
components: rust-src
230+
207231
- name: Build binary
208-
run: bash tool/build_macos.sh x64
232+
run: ./tool/build_macos.sh x64
209233

210234
- name: Upload binary
211235
uses: ./.github/actions/upload

RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ git push --tags
2121
Build:
2222

2323
```
24-
gh workflow run release --ref v1.2.3
24+
gh workflow run release --ref v1.2.3 -f publish=true
2525
```
2626

2727
The above does the following:

0 commit comments

Comments
 (0)