-
Notifications
You must be signed in to change notification settings - Fork 1
Fix CD pipeline. #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Yury-Fridlyand
wants to merge
16
commits into
main
Choose a base branch
from
yuryf/fix-cd
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix CD pipeline. #38
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
28bae02
Fix CD pipeline.
Yury-Fridlyand ce0d5af
fix the path
Yury-Fridlyand 2685448
fix the path
Yury-Fridlyand 4fb0a79
fix the path
Yury-Fridlyand d1bf727
fix the path
Yury-Fridlyand 33a4fe3
Fix unpublish condition.
Yury-Fridlyand 44fcc03
Fix env vars and paths
Yury-Fridlyand 42fad7d
fix condition
Yury-Fridlyand 23be90d
Add waiting for package
Yury-Fridlyand 9d1e2f2
script fix
Yury-Fridlyand 8818281
script fix
Yury-Fridlyand d737a25
script fix
Yury-Fridlyand bf91322
update nuspec
Yury-Fridlyand ea8b6c3
Add icon
Yury-Fridlyand 4757b27
Try to fix symbol package
Yury-Fridlyand 36da42e
typo fix
Yury-Fridlyand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ jobs: | |
PLATFORM_MATRIX: ${{ steps.load-platform-matrix.outputs.PLATFORM_MATRIX }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
uses: actions/checkout@v5 | ||
|
||
- name: load-platform-matrix | ||
id: load-platform-matrix | ||
|
@@ -75,7 +75,7 @@ jobs: | |
runs-on: ${{ matrix.host.RUNNER }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v5 | ||
with: | ||
submodules: true | ||
|
||
|
@@ -91,7 +91,6 @@ jobs: | |
os: ${{ matrix.host.OS }} | ||
target: ${{ matrix.host.TARGET }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
engine-version: ${{ matrix.engine.version }} | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
|
@@ -104,7 +103,6 @@ jobs: | |
run: | | ||
cargo zigbuild -r --target ${{ matrix.host.TARGET }}.2.17 | ||
mkdir -p target/release | ||
cp target/*/release/libglide_rs.so target/release/ | ||
|
||
- name: Build native libs | ||
if: ${{ !contains(matrix.host.TARGET, 'linux-gnu') }} | ||
|
@@ -116,18 +114,19 @@ jobs: | |
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.host.TARGET }} | ||
if-no-files-found: error | ||
path: | | ||
rust/target/release/*.so | ||
rust/target/release/*.dylib | ||
rust/target/release/*.dll | ||
rust/target/${{ matrix.host.TARGET }}/release/*.so | ||
rust/target/${{ matrix.host.TARGET }}/release/*.dylib | ||
rust/target/${{ matrix.host.TARGET }}/release/*.dll | ||
|
||
build-package-to-publish: | ||
needs: [set-release-version, create-binaries] | ||
runs-on: ubuntu-latest | ||
env: | ||
RELEASE_VERSION: ${{ needs.set-release-version.outputs.RELEASE_VERSION }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, this step builds dotnet code only |
||
|
||
- name: Download published artifacts | ||
uses: actions/download-artifact@v4 | ||
|
@@ -154,25 +153,28 @@ jobs: | |
- name: Pack the client | ||
working-directory: sources/Valkey.Glide | ||
run: | | ||
dotnet build Valkey.Glide.csproj --configuration Release /property:Version=${{ env.RELEASE_VERSION }} | ||
dotnet pack Valkey.Glide.csproj --configuration Release -p:NuspecProperties=version=${{ env.RELEASE_VERSION }} | ||
dotnet build Valkey.Glide.csproj --configuration Release /property:Version=$RELEASE_VERSION | ||
dotnet pack Valkey.Glide.csproj --configuration Release -p:NuspecProperties=version=$RELEASE_VERSION | ||
tree -h bin/Release | ||
unzip -l bin/Release/Valkey.Glide.${{ env.RELEASE_VERSION }}.nupkg | ||
unzip -l bin/Release/Valkey.Glide.${{ env.RELEASE_VERSION }}.symbols.nupkg | ||
unzip -l bin/Release/Valkey.Glide.$RELEASE_VERSION.nupkg | ||
unzip -l bin/Release/Valkey.Glide.$RELEASE_VERSION.snupkg | ||
env: | ||
SkipCargo: true | ||
|
||
- name: Upload artifacts to publish | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: package | ||
path: sources/Valkey.Glide/bin/Release/Valkey.Glide.*.nupkg | ||
if-no-files-found: error | ||
path: sources/Valkey.Glide/bin/Release/Valkey.Glide.*nupkg | ||
|
||
publish: | ||
environment: Release | ||
if: ${{ (inputs.nuget_publish == true || github.event_name == 'push') && github.repository_owner == 'valkey-io' }} | ||
needs: [build-package-to-publish] | ||
needs: [build-package-to-publish, set-release-version] | ||
runs-on: ubuntu-latest | ||
env: | ||
RELEASE_VERSION: ${{ needs.set-release-version.outputs.RELEASE_VERSION }} | ||
steps: | ||
- name: Download package | ||
uses: actions/download-artifact@v4 | ||
|
@@ -182,11 +184,31 @@ jobs: | |
- name: Publish | ||
run: | | ||
ls -lh | ||
dotnet nuget push Valkey.Glide.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | ||
dotnet nuget push Valkey.Glide.$RELEASE_VERSION.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | ||
|
||
- name: Wait for package to be ready for download | ||
run: | | ||
dotnet new console --name temp-check --output . --framework net8.0 | ||
TIMEOUT=600 # 10 minutes | ||
INTERVAL=10 # 10 seconds | ||
ELAPSED=0 | ||
|
||
while [ $ELAPSED -lt $TIMEOUT ]; do | ||
echo "Checking availability... (${ELAPSED}s elapsed)" | ||
if dotnet add package Valkey.Glide --version $RELEASE_VERSION ; then | ||
echo "Package is now available!" | ||
exit 0 | ||
fi | ||
sleep $INTERVAL | ||
ELAPSED=$((ELAPSED + INTERVAL)) | ||
dotnet nuget locals all --clear | ||
done | ||
|
||
echo "Timeout: Package is not available after ${TIMEOUT}s" | ||
exit 1 | ||
|
||
test: | ||
needs: [publish, set-release-version, load-platform-matrix] | ||
if: ${{ !cancelled() }} | ||
timeout-minutes: 35 | ||
strategy: | ||
# Run all jobs | ||
|
@@ -197,7 +219,9 @@ jobs: | |
env: | ||
RELEASE_VERSION: ${{ needs.set-release-version.outputs.RELEASE_VERSION }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v5 | ||
with: | ||
submodules: true | ||
|
||
- name: Download package | ||
if: ${{ needs.publish.result == 'skipped' }} | ||
|
@@ -232,15 +256,15 @@ jobs: | |
shell: bash | ||
run: | | ||
dotnet remove reference $(dotnet list reference | tail -n +3) | ||
dotnet add package Valkey.Glide --version ${{ env.RELEASE_VERSION }} | ||
dotnet add package Valkey.Glide --version $RELEASE_VERSION | ||
git diff | ||
|
||
- name: Install engine | ||
- name: Install server | ||
# TODO activate this on windows once fixed, see https://github.com/valkey-io/valkey-glide-csharp/issues/6 | ||
if: ${{ matrix.host.OS != 'windows' }} | ||
uses: ./.github/workflows/install-engine | ||
uses: ./.github/workflows/install-server | ||
with: | ||
engine-version: 8.1 | ||
server-version: 8.1 | ||
target: ${{ matrix.host.TARGET }} | ||
|
||
- name: Run tests | ||
|
@@ -268,5 +292,5 @@ jobs: | |
RELEASE_VERSION: ${{ needs.set-release-version.outputs.RELEASE_VERSION }} | ||
steps: | ||
- name: Remove package from NuGet due to test failures | ||
if: ${{ needs.test.result == 'failure' && needs.publish.result == 'success' }} | ||
run: dotnet nuget delete Valkey.Glide ${{ env.RELEASE_VERSION }} --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --non-interactive | ||
if: ${{ (needs.test.result == 'failure' && needs.publish.result == 'success') || needs.publish.result == 'failure' }} | ||
run: dotnet nuget delete Valkey.Glide $RELEASE_VERSION --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --non-interactive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that the corresponding input name on this repo has been changed to
server-version
. But if it is intentional to skip the installation of valkey-server in this job (as there's an if-condition on theInstall server
step ofinstall-shared-dependencies
) then its fine.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It
doesshould not install the server if input is not givenvalkey-glide-csharp/.github/workflows/install-shared-dependencies/action.yml
Line 61 in 2ec87f6