diff --git a/.github/bin/dist-pack.sh b/.github/bin/dist-pack.sh index 07744358f9..e3eabe8ce1 100755 --- a/.github/bin/dist-pack.sh +++ b/.github/bin/dist-pack.sh @@ -16,6 +16,18 @@ version_prefix="$(cat obj/version_prefix.txt)" # e.g. 0.50.0 if [[ -f obj/version_suffix.txt ]]; then # e.g. dev.20230221015836+35a2dbc version_suffix="$(cat obj/version_suffix.txt)" fi +repository_url="$(cat obj/repository_url.txt)" + +property_name="RepositoryUrl" +property_file="Directory.Build.props" + +repository_url=$(grep -oP "(?<=<$property_name>).*?(?=)" "$property_file") +if [[ $? -ne 0 ]]; then + echo "Property '$property_name' is already set in '$property_file'." > /dev/stderr + exit 1 +fi +repository_url=$(echo "$repository_url" | sed 's/\.git$//') +echo $repository_url for project in "${executables[@]}"; do for rid in "${rids[@]}"; do @@ -63,6 +75,8 @@ for project in "${projects[@]}"; do dotnet_args="$dotnet_args --version-suffix=$version_suffix" dotnet_args="$dotnet_args -p:NoPackageAnalysis=true" fi + + 's/\.git$//' dotnet_args="$dotnet_args -p:_IsPacking=true" # shellcheck disable=SC2086 dotnet build -c "$configuration" $dotnet_args || \ diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 85aec795f0..da4497ef87 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,7 +2,7 @@ on: push: branches: - - "main" + - "ci/nuget-repo-url" tags: - "*" name: Build artifact and push @@ -51,39 +51,11 @@ jobs: fi echo "$PACKAGE_VERSION" > obj/package_version.txt echo "$VERSION_TYPE" > obj/version_type.txt + echo "https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}" + echo "https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}" > obj/repository_url.txt env: VERSION_PREFIX: ${{ steps.determine-version.outputs.version-prefix }} VERSION_SUFFIX: ${{ steps.determine-version.outputs.version-suffix }} PACKAGE_VERSION: ${{ steps.determine-version.outputs.package-version }} VERSION_TYPE: ${{ steps.determine-version.outputs.version-type }} - run: .github/bin/dist-release-note.sh CHANGES.md obj/release_note.txt - - uses: actions/upload-artifact@main - with: - name: dist-obj - path: obj/ - - run: .github/bin/dist-pack.sh - - run: | - . .github/bin/constants.sh - mkdir -p /tmp/dist-bin/ - for project in "${projects[@]}"; do - cp -r "$project/bin/$configuration"/* /tmp/dist-bin/ - done - for npmpkg in "${npm_packages[@]}"; do - cp "$npmpkg"/*.tgz /tmp/dist-bin/ - done - - uses: actions/upload-artifact@main - with: - name: dist-bin - path: /tmp/dist-bin/ - - if: startsWith(github.ref, 'refs/tags/') - run: .github/bin/dist-github-release.sh - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: env.NUGET_API_KEY != '' - run: .github/bin/dist-nuget.sh - env: - NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} - - if: env.NODE_AUTH_TOKEN != '' - run: .github/bin/dist-npm.sh - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}