Add: enhance ApiResponse with extra data handling and deprecate getSp… #19
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 JAR to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| publish-jar: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Extract version from build.gradle.kts | |
| id: extract_version | |
| run: | | |
| VERSION=$(./gradlew -q printVersion) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Extracted version: $VERSION" | |
| - name: Check if tag already exists | |
| id: check_tag | |
| run: | | |
| if git tag -l "${{ steps.extract_version.outputs.version }}" | grep -q "${{ steps.extract_version.outputs.version }}"; then | |
| echo "tag_exists=true" >> $GITHUB_OUTPUT | |
| echo "Tag ${{ steps.extract_version.outputs.version }} already exists" | |
| else | |
| echo "tag_exists=false" >> $GITHUB_OUTPUT | |
| echo "Tag ${{ steps.extract_version.outputs.version }} does not exist" | |
| fi | |
| - name: Publish Maven artifacts to local repo | |
| run: ./gradlew publish | |
| env: | |
| GROUP_ID: fr.sandro642.github | |
| ARTIFACT_ID: ConnectorAPI | |
| VERSION: ${{ steps.extract_version.outputs.version }} | |
| - name: Deploy to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| token: ${{ secrets.GH_TOKEN }} | |
| repository-name: sandro642/sandro642.github.io | |
| branch: main | |
| folder: build/repo | |
| target-folder: connectorapi/jar | |
| - name: Create and push Git tag | |
| if: steps.check_tag.outputs.tag_exists == 'false' | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| # S'assurer qu'on pousse vers le bon repository | |
| git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git | |
| # Créer et pousser le tag | |
| git tag -a "${{ steps.extract_version.outputs.version }}" -m "Release version ${{ steps.extract_version.outputs.version }}" | |
| git push origin "${{ steps.extract_version.outputs.version }}" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |