@@ -35,41 +35,19 @@ jobs:
3535
3636 - name : Update version in pom.xml
3737 run : |
38- sed -i "/<artifactId>featurevisor-java<\/artifactId>/,/<version>/ s/<version>.*<\/version>/<version>${{ steps.version.outputs.version }}<\/version>/" pom.xml
39- echo "Updated pom.xml version to ${{ steps.version.outputs.version }}"
38+ # Cross-platform sed command that works on both Linux and macOS
39+ if [[ "$OSTYPE" == "darwin"* ]]; then
40+ # macOS (BSD sed)
41+ sed -i '' "/<artifactId>featurevisor-java<\/artifactId>/,/<version>/ s/<version>.*<\/version>/<version>${{ steps.version.outputs.version }}<\/version>/" pom.xml
42+ else
43+ # Linux (GNU sed)
44+ sed -i "/<artifactId>featurevisor-java<\/artifactId>/,/<version>/ s/<version>.*<\/version>/<version>${{ steps.version.outputs.version }}<\/version>/" pom.xml
45+ fi
46+
47+ cat pom.xml | grep '<version>'
4048
4149 - name : Build and Publish
4250 env :
4351 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4452 run : |
45- # Create Maven settings for GitHub Packages authentication
46- cat > ~/.m2/settings.xml << EOF
47- <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
48- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
49- xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
50- http://maven.apache.org/xsd/settings-1.0.0.xsd">
51- <servers>
52- <server>
53- <id>github</id>
54- <username>${GITHUB_ACTOR}</username>
55- <password>${GITHUB_TOKEN}</password>
56- </server>
57- </servers>
58- </settings>
59- EOF
60-
6153 mvn clean deploy -DskipTests
62-
63- - name : Make package public
64- run : |
65- # Get the package name from pom.xml
66- PACKAGE_NAME="com.featurevisor__featurevisor-java"
67-
68- # Make the package public using GitHub API
69- curl -X POST \
70- -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
71- -H "Accept: application/vnd.github.v3+json" \
72- https://api.github.com/user/packages/maven/$PACKAGE_NAME/visibility \
73- -d '{"visibility":"public"}'
74-
75- echo "Made package $PACKAGE_NAME public"
0 commit comments