Skip to content

Commit

Permalink
It packages as expected!
Browse files Browse the repository at this point in the history
  • Loading branch information
OoLunar committed Jul 7, 2024
1 parent 903a09a commit 6487a65
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/package-opus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ git fetch --tags

# Export the latest tag
OPUS_VERSION="$(git describe --tags $(git rev-list --tags --max-count=1))"
echo "OPUS_VERSION=$OPUS_VERSION" >> $GITHUB_ENV
echo "version=$OPUS_VERSION" >> $GITHUB_OUTPUT

# Checkout the latest tag
git checkout "$OPUS_VERSION"
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/package-sodium.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ git fetch --tags

# Export the latest tag
SODIUM_VERSION="$(git describe --tags $(git rev-list --tags --max-count=1))"
echo "SODIUM_VERSION=$SODIUM_VERSION" >> $GITHUB_ENV
echo "version=$SODIUM_VERSION" >> $GITHUB_OUTPUT

# Checkout the latest tag
git checkout "$SODIUM_VERSION"
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/opus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
build:
name: Build Opus for ${{ matrix.config.rid }}
runs-on: ${{ matrix.config.os }}
outputs:
version: ${{ steps.build.outputs.version }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -46,7 +48,7 @@ jobs:
args: "",
find-file: "libopus.so.*.*.*",
file: "libopus.so",
rid: "linux-x64-musl"
rid: "linux-musl-x64"
}
- {
os: ubuntu-latest,
Expand All @@ -69,7 +71,7 @@ jobs:
args: "",
find-file: "libopus.so.*.*.*",
file: "libopus.so",
rid: "linux-arm64-musl"
rid: "linux-musl-arm64"
}
- {
os: macos-latest,
Expand Down Expand Up @@ -145,6 +147,7 @@ jobs:
shell: bash
run: ${{ matrix.config.install-deps }}
- name: "Build ${{ matrix.config.file }}"
id: build
shell: bash
run: |
export WORKSPACE='${{ github.workspace }}'
Expand All @@ -159,6 +162,19 @@ jobs:
with:
add: "libs/libopus/"
default_author: github_actions
message: Update ${{ matrix.config.rid }} to ${{ env.OPUS_VERSION }}
message: Update ${{ matrix.config.rid }} to ${{ steps.build.outputs.version }}
pull: "--rebase --autostash"
push: true
push: true
update-version:
name: Update .NET project version
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update version
run: |
sed -i "s/<VERSION>.*<\/VERSION>/<VERSION>${{ needs.build.outputs.version }}<\/VERSION>/" "${{ github.workspace }}/src/DSharpPlus.VoiceLink.Natives.Opus/DSharpPlus.VoiceLink.Natives.Opus.csproj"
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 20 additions & 4 deletions .github/workflows/sodium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
build:
name: Build Sodium for ${{ matrix.config.rid }}
runs-on: ${{ matrix.config.os }}
outputs:
version: ${{ steps.build.outputs.version }}
strategy:
fail-fast: false
matrix:
Expand All @@ -38,7 +40,7 @@ jobs:
command: "zig build -Dshared=true -Doptimize=ReleaseFast -Dtarget=x86_64-linux-musl",
output-file: "zig-out/lib/libsodium.so",
file: "libsodium.so",
rid: "linux-x64-musl",
rid: "linux-musl-x64",
}
- {
os: ubuntu-latest,
Expand All @@ -52,7 +54,7 @@ jobs:
command: "zig build -Dshared=true -Doptimize=ReleaseFast -Dtarget=aarch64-linux-musl",
output-file: "zig-out/lib/libsodium.so",
file: "libsodium.so",
rid: "linux-arm64-musl",
rid: "linux-musl-arm64",
}
- {
os: macos-latest,
Expand Down Expand Up @@ -119,6 +121,7 @@ jobs:
if: contains(matrix.config.rid, 'android')
uses: android-actions/setup-android@v3
- name: "Build ${{ matrix.config.file }}"
id: build
shell: bash
run: |
export WORKSPACE='${{ github.workspace }}'
Expand All @@ -133,6 +136,19 @@ jobs:
with:
add: "libs/libsodium/"
default_author: github_actions
message: Update ${{ matrix.config.rid }} to ${{ env.SODIUM_VERSION }}
message: Update ${{ matrix.config.rid }} to ${{ steps.build.outputs.version }}
pull: "--rebase --autostash"
push: true
push: true
update-version:
name: Update .NET project version
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update version
run: |
sed -i "s/<VERSION>.*<\/VERSION>/<VERSION>${{ needs.build.outputs.version }}<\/VERSION>/" "${{ github.workspace }}/src/DSharpPlus.VoiceLink.Natives.Sodium/DSharpPlus.VoiceLink.Natives.Sodium.csproj"
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 0 additions & 2 deletions examples/HelloWorld/HelloWorld.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(ProjectRoot)/src/DSharpPlus.VoiceLink/DSharpPlus.VoiceLink.csproj" />
<ProjectReference Include="$(ProjectRoot)/src/DSharpPlus.VoiceLink.Natives.Sodium/DSharpPlus.VoiceLink.Natives.Sodium.csproj" />
<ProjectReference Include="$(ProjectRoot)/src/DSharpPlus.VoiceLink.Natives.Opus/DSharpPlus.VoiceLink.Natives.Opus.csproj" />
</ItemGroup>
</Project>
Binary file removed libs/libopus/linux-arm64-musl/native/libopus.so
Binary file not shown.
Binary file removed libs/libopus/linux-x64-musl/native/libopus.so
Binary file not shown.
Binary file removed libs/libsodium/linux-arm64-musl/native/libsodium.so
Binary file not shown.
Binary file removed libs/libsodium/linux-x64-musl/native/libsodium.so
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<PackageTags>discord, discord-bot, discord-api, dsharpplus, discord-voice, dsharpplus-voicenext</PackageTags>
<Authors>OoLunar, InFTord, Aaron2550</Authors>
<IsPackable>true</IsPackable>
<Version>0.1.0</Version>
</PropertyGroup>
<ItemGroup>
<Content CopyToOutputDirectory="PreserveNewest" Include="$(ProjectRoot)/libs/libopus/**/*" Link="runtimes/%(RecursiveDir)%(FileName)%(Extension)" Pack="true" PackagePath="runtimes/%(RecursiveDir)%(FileName)%(Extension)" />
<None Include="$(ProjectRoot)/libs/libopus/**/*" Pack="true" PackagePath="runtimes" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<PackageTags>discord, discord-bot, discord-api, dsharpplus, discord-voice, dsharpplus-voicenext</PackageTags>
<Authors>OoLunar, InFTord, Aaron2550</Authors>
<IsPackable>true</IsPackable>
<Version>0.1.0</Version>
</PropertyGroup>
<ItemGroup>
<Content CopyToOutputDirectory="PreserveNewest" Include="$(ProjectRoot)/libs/libsodium/**/*" Link="runtimes/%(RecursiveDir)%(FileName)%(Extension)" Pack="true" PackagePath="runtimes/%(RecursiveDir)%(FileName)%(Extension)" />
<None Include="$(ProjectRoot)/libs/libsodium/**/*" Pack="true" PackagePath="runtimes" />
</ItemGroup>
</Project>

0 comments on commit 6487a65

Please sign in to comment.