feat: add msg placeholder #2
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: Build and Release | |
| on: | |
| push: | |
| branches: ['**'] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build with Gradle | |
| run: ./gradlew build | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: swaparoo-jar | |
| path: build/libs/*.jar | |
| - name: Extract version | |
| id: get_version | |
| run: | | |
| VERSION=$(grep -m1 "^version" build.gradle | cut -d"'" -f2) | |
| echo "Extract build version: ${VERSION}" | |
| echo "version=${VERSION}" >> "$GITHUB_OUTPUT" | |
| - name: Set release version | |
| id: release_version | |
| run: | | |
| echo "release=${{ steps.get_version.outputs.version }}.${{ github.run_number }}" >> "$GITHUB_OUTPUT" | |
| - name: Create GitHub Release | |
| if: github.ref == 'refs/heads/main' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: "v${{ steps.release_version.outputs.release }}" | |
| name: "Release v${{ steps.release_version.outputs.release }}" | |
| files: build/libs/*.jar | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |