Skip to content

Commit 15ba8bf

Browse files
committed
feat(CI): upload cross-compiled artifact to new release
1 parent 1fa9654 commit 15ba8bf

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed

.github/workflows/cross-compile.yml

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# inspired by https://github.com/topheman/update-homebrew-tap-playground/blob/master/.github/workflows/cross-compile.yml# inspired by https://github.com/topheman/update-homebrew-tap-playground/blob/master/.github/workflows/cross-compile.yml
1+
# inspired by https://github.com/topheman/update-homebrew-tap-playground/blob/master/.github/workflows/cross-compile.yml
22
name: Cross-Compile
33

44
on: [push]
@@ -52,7 +52,8 @@ jobs:
5252
with:
5353
path: ./compressed
5454
key: ${{ matrix.platform.target }}-compressed-binaries-${{ github.sha }}
55-
upload-archives: # will be changed for release-draft
55+
upload-archives:
56+
if: false # This step is totally skipped, activate the workflow outside of a tag (for debug purposes)
5657
needs: build
5758
name: Upload archive for build ${{ matrix.platform.target }}
5859
strategy:
@@ -75,4 +76,43 @@ jobs:
7576
path: ./compressed/
7677
name: ${{ env.BINARY_NAME }}-${{ matrix.platform.target }}.tar.gz
7778
retention-days: 10
78-
79+
create-release-draft-if-not-exist:
80+
if: github.ref_type == 'tag'
81+
permissions:
82+
contents: write
83+
needs: build
84+
runs-on: ubuntu-latest
85+
steps:
86+
- uses: actions/checkout@v4
87+
- name: Create release draft
88+
uses: topheman/create-release-if-not-exist@v1
89+
with:
90+
args: ${{ github.ref_name }} --draft --generate-notes
91+
upload-artifacts-to-release-draft:
92+
if: github.ref_type == 'tag'
93+
permissions:
94+
contents: write
95+
needs: create-release-draft-if-not-exist
96+
env:
97+
RELEASE_NAME: ${{ github.ref_name }}
98+
name: Upload artifacts to release draft ${{ matrix.platform.target }}
99+
strategy:
100+
matrix:
101+
platform:
102+
- target: x86_64-unknown-linux-gnu
103+
- target: aarch64-unknown-linux-gnu
104+
- target: x86_64-apple-darwin
105+
- target: aarch64-apple-darwin
106+
runs-on: ubuntu-latest
107+
steps:
108+
- uses: actions/checkout@v4
109+
- name: Restore cached compressed binaries
110+
uses: actions/cache/restore@v4
111+
with:
112+
path: ./compressed
113+
key: ${{ matrix.platform.target }}-compressed-binaries-${{ github.sha }}
114+
- name: Upload artifacts to release draft
115+
run: |
116+
gh release upload ${{ env.RELEASE_NAME }} ./compressed/${{ env.BINARY_NAME }}-${{ matrix.platform.target }}.tar.gz
117+
env:
118+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/rust-host.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ on: [push, pull_request]
33

44
jobs:
55
build-and-test:
6-
if: false # TODO: remove
76
runs-on: ubuntu-latest
87
steps:
98
- name: Set variables based on OS and architecture for just dl-wasi-sdk

.github/workflows/web-host.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ on: [push, pull_request]
33

44
jobs:
55
build:
6-
if: false # TODO: remove
76
runs-on: ubuntu-latest
87
steps:
98
- name: Set variables based on OS and architecture for just dl-wasi-sdk

0 commit comments

Comments
 (0)