Weekly Release Robot #7
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: Weekly Release Robot | |
| on: | |
| schedule: | |
| # Run every Sunday at 23:55 UTC (5 min to still get "today" date) | |
| - cron: '55 23 * * 0' | |
| workflow_dispatch: # Allow manual triggering | |
| permissions: | |
| contents: write | |
| jobs: | |
| weekly-release: | |
| runs-on: ubuntu-24.04 | |
| name: Weekly Release | |
| steps: | |
| - name: Checkout with submodules | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| ref: next | |
| submodules: true | |
| fetch-depth: 0 # To make git describe give the intended output | |
| - name: Setup java | |
| uses: actions/setup-java@v4.7.0 | |
| with: | |
| java-version: 11 | |
| distribution: zulu | |
| cache: maven | |
| - name: Set version with current date | |
| run: | | |
| VERSION=$(date +'%y.%m.%d') | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| ./mvnw versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false | |
| - name: Run Maven | |
| run: ./mvnw -T1C -B -U verify | |
| - name: Get SHA-256 of JAR | |
| run: echo "JARSUM=$(shasum -a 256 --tag ./tool/target/jcard.jar)" >> "$GITHUB_ENV" | |
| - name: Set SSH key | |
| uses: webfactory/ssh-agent@v0.9.1 | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_KEY }} | |
| - name: Add known host key | |
| run: ssh-keyscan mvn.javacard.pro >> ~/.ssh/known_hosts | |
| - name: Deploy package | |
| run: ./mvnw -B deploy | |
| - name: Release | |
| uses: softprops/action-gh-release@v2.2.1 | |
| with: | |
| prerelease: true | |
| tag_name: v${{ env.VERSION }} | |
| name: Weekly v${{ env.VERSION }} | |
| files: ./tool/target/jcard.jar | |
| fail_on_unmatched_files: true | |
| body: | | |
| ## Weekly release v${{ env.VERSION }} | |
| `${{ env.JARSUM }}` (built with JDK-11) |