Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
s2quake committed Jul 29, 2024
1 parent b877fb9 commit 4b2b797
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 31 deletions.
14 changes: 14 additions & 0 deletions .github/bin/dist-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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_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
Expand Down Expand Up @@ -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 || \
Expand Down
34 changes: 3 additions & 31 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
on:
push:
branches:
- "main"
- "ci/nuget-repo-url"
tags:
- "*"
name: Build artifact and push
Expand Down Expand Up @@ -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 }}

0 comments on commit 4b2b797

Please sign in to comment.