chore: readme updates #7
Workflow file for this run
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
| name: Publish to GitHub Packages | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Required for flatten-maven-plugin to work with Git tags | |
| - name: Set up JDK 24 and Maven | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "24" | |
| distribution: "temurin" | |
| cache: "maven" | |
| - name: Extract version from Git tag | |
| id: version | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Extracted version: $VERSION" | |
| - name: Update version in pom.xml | |
| run: | | |
| # Cross-platform sed command that works on both Linux and macOS | |
| if [[ "$OSTYPE" == "darwin"* ]]; then | |
| # macOS (BSD sed) | |
| sed -i '' "/<artifactId>featurevisor-java<\/artifactId>/,/<version>/ s/<version>.*<\/version>/<version>${{ steps.version.outputs.version }}<\/version>/" pom.xml | |
| else | |
| # Linux (GNU sed) | |
| sed -i "/<artifactId>featurevisor-java<\/artifactId>/,/<version>/ s/<version>.*<\/version>/<version>${{ steps.version.outputs.version }}<\/version>/" pom.xml | |
| fi | |
| cat pom.xml | grep '<version>' | |
| - name: Build and Publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| mvn clean deploy -DskipTests |