add: Config Update v3 to v4 #156
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: Maven Package | |
| on: [push] | |
| jobs: | |
| build: | |
| environment: env | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: TARGET_VERSION | |
| run: echo TARGET_VERSION=${{ vars.TARGET_VERSION }} | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v1 | |
| with: | |
| java-version: 21 | |
| - name: Build with Maven | |
| run: mvn clean package | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: AutoCommand-${{ vars.TARGET_VERSION }} | |
| path: target/*.jar | |
| release: | |
| if: github.ref == 'refs/heads/master' && !startsWith(github.event.head_commit.message, 'chore:') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: env | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: TARGET_VERSION | |
| run: echo TARGET_VERSION=${{ vars.TARGET_VERSION }} | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: AutoCommand-${{ vars.TARGET_VERSION }} | |
| path: ./target | |
| - name: List target directory | |
| run: ls -la ./target | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ vars.TARGET_VERSION }} | |
| release_name: ACMD ${{ vars.TARGET_VERSION }} | |
| draft: true | |
| prerelease: false | |
| - name: Upload Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./target/AutoCommand-${{ vars.TARGET_VERSION }}.jar | |
| asset_name: AutoCommand-${{ vars.TARGET_VERSION }}.jar | |
| asset_content_type: application/java-archive |