Skip to content

Commit 53bc652

Browse files
authored
binary uploading to github is added.
1 parent 9c6d5d3 commit 53bc652

File tree

1 file changed

+69
-4
lines changed

1 file changed

+69
-4
lines changed

.github/workflows/release.yml

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,21 @@ jobs:
2525
- name: Generate Release Notes
2626
id: release_notes
2727
run: |
28+
echo "### Release Notes" > RELEASE_NOTES.md
2829
if [ -n "${{ steps.previoustag.outputs.tag }}" ]; then
29-
echo "### Changes since ${{ steps.previoustag.outputs.tag }}" > RELEASE_NOTES.md
30-
git log ${{ steps.previoustag.outputs.tag }}..HEAD --pretty=format:"* %s (%h)" --reverse | grep -i "^* Merge pull request" >> RELEASE_NOTES.md
30+
{
31+
echo "### Changes since ${{ steps.previoustag.outputs.tag }}" >> RELEASE_NOTES.md
32+
git log ${{ steps.previoustag.outputs.tag }}..HEAD --pretty=format:"* %s (%h)" --reverse | grep -i "^* Merge pull request" >> RELEASE_NOTES.md
33+
} || {
34+
echo "No changes to document" >> RELEASE_NOTES.md
35+
}
3136
else
32-
echo "### Initial Release" > RELEASE_NOTES.md
33-
git log --pretty=format:"* %s (%h)" --reverse | grep -i "^* Merge pull request" >> RELEASE_NOTES.md
37+
{
38+
echo "### Initial Release" >> RELEASE_NOTES.md
39+
git log --pretty=format:"* %s (%h)" --reverse | grep -i "^* Merge pull request" >> RELEASE_NOTES.md
40+
} || {
41+
echo "Initial release - no changes to document" >> RELEASE_NOTES.md
42+
}
3443
fi
3544
3645
- name: Create Release
@@ -40,6 +49,62 @@ jobs:
4049
body_path: RELEASE_NOTES.md
4150
draft: false
4251
prerelease: false
52+
53+
build-and-upload:
54+
name: Build and Upload
55+
needs: create-release
56+
strategy:
57+
matrix:
58+
include:
59+
- os: ubuntu-latest
60+
target: x86_64-unknown-linux-gnu
61+
artifact_name: wwdc-parser
62+
asset_name: wwdc-parser-linux-amd64
63+
- os: ubuntu-latest
64+
target: aarch64-unknown-linux-gnu
65+
artifact_name: wwdc-parser
66+
asset_name: wwdc-parser-linux-arm64
67+
- os: windows-latest
68+
target: x86_64-pc-windows-msvc
69+
artifact_name: wwdc-parser.exe
70+
asset_name: wwdc-parser-windows-amd64.exe
71+
- os: macos-latest
72+
target: x86_64-apple-darwin
73+
artifact_name: wwdc-parser
74+
asset_name: wwdc-parser-macos-amd64
75+
- os: macos-latest
76+
target: aarch64-apple-darwin
77+
artifact_name: wwdc-parser
78+
asset_name: wwdc-parser-macos-arm64
79+
runs-on: ${{ matrix.os }}
80+
steps:
81+
- uses: actions/checkout@v4
82+
83+
- name: Install Rust
84+
uses: dtolnay/rust-toolchain@stable
85+
with:
86+
targets: ${{ matrix.target }}
87+
88+
- name: Install cross-compilation dependencies
89+
if: matrix.target == 'aarch64-unknown-linux-gnu'
90+
run: |
91+
sudo apt-get update
92+
sudo apt-get install -y gcc-aarch64-linux-gnu
93+
94+
- name: Build binary
95+
run: |
96+
cargo build --release --target ${{ matrix.target }}
97+
98+
- name: Rename binary
99+
shell: bash
100+
run: |
101+
cd target/${{ matrix.target }}/release
102+
mv ${{ matrix.artifact_name }} ${{ matrix.asset_name }}
103+
104+
- name: Upload binary to release
105+
uses: softprops/action-gh-release@v1
106+
with:
107+
files: target/${{ matrix.target }}/release/${{ matrix.asset_name }}
43108

44109
publish-crate:
45110
needs: create-release

0 commit comments

Comments
 (0)