|
1 | | -name: Publish Attollo to platforms |
2 | | -on: |
| 1 | +name: Release |
| 2 | +"on": |
3 | 3 | push: |
4 | 4 | branches: |
5 | | - - master |
6 | | - - develop |
| 5 | + - main |
| 6 | + - next |
| 7 | + - beta |
| 8 | + - alpha |
| 9 | + - "*.x" |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read # for checkout |
| 13 | + |
7 | 14 | jobs: |
8 | | - Publish: |
9 | | - name: 'Publish to EldoNexus, Modrinth and Hangar' |
10 | | - # Run on all label events (won't be duplicated) or all push events or on PR syncs not from the same repo |
11 | | - if: github.repository_owner == 'OneLiteFeatherNET' |
| 15 | + release: |
| 16 | + name: Release |
12 | 17 | runs-on: ubuntu-latest |
| 18 | + permissions: |
| 19 | + contents: write # to be able to publish a GitHub release |
| 20 | + issues: write # to be able to comment on released issues |
| 21 | + pull-requests: write # to be able to comment on released pull requests |
| 22 | + id-token: write # to enable use of OIDC for npm provenance |
13 | 23 | steps: |
14 | | - - name: Checkout Repository |
| 24 | + - name: Checkout |
15 | 25 | uses: actions/checkout@v5 |
16 | | - - name: Setup Gradle |
17 | | - uses: gradle/actions/setup-gradle@v4 |
| 26 | + with: |
| 27 | + fetch-depth: 0 |
| 28 | + - name: Setup Node.js |
| 29 | + uses: actions/setup-node@v6 |
| 30 | + with: |
| 31 | + node-version: "lts/*" |
| 32 | + - name: Validate Gradle Wrapper |
| 33 | + uses: gradle/actions/wrapper-validation@v5 |
18 | 34 | - name: Setup Java |
19 | | - uses: actions/setup-java@v4 |
| 35 | + uses: actions/setup-java@v5 |
20 | 36 | with: |
21 | 37 | distribution: temurin |
22 | | - cache: gradle |
23 | | - java-version: 17 |
24 | | - - name: Publish to Jar |
25 | | - run: ./gradlew build publishAllPublicationsToHangar modrinth publish -x test |
| 38 | + java-version: 24 |
| 39 | + - name: Setup Gradle |
| 40 | + uses: gradle/actions/setup-gradle@v5 |
| 41 | + - name: Install dependencies |
| 42 | + run: npm clean-install |
| 43 | + - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies |
| 44 | + run: npm audit signatures |
| 45 | + - name: Release |
26 | 46 | env: |
27 | | - ELDO_USERNAME: "${{ secrets.ELDO_USERNAME }}" |
28 | | - ELDO_PASSWORD: "${{ secrets.ELDO_PASSWORD }}" |
| 47 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 48 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
29 | 49 | HANGAR_SECRET: ${{secrets.HANGAR_KEY}} |
30 | 50 | MODRINTH_TOKEN: ${{ secrets.MODRINTH_KEY }} |
| 51 | + # Token with permissions to push to the client repository |
| 52 | + CLIENT_REPO_TOKEN: ${{ secrets.CLIENT_REPO_TOKEN }} |
| 53 | + run: npx semantic-release |
| 54 | + - name: Get Version |
| 55 | + id: get_version |
| 56 | + run: echo "VERSION=$(cat VERSION.txt)" >> $GITHUB_ENV |
| 57 | + - name: Upload BOM to Dependency-Track |
| 58 | + uses: DependencyTrack/gh-upload-sbom@v3 |
| 59 | + with: |
| 60 | + serverhostname: ${{ secrets.DEPENDENCYTRACK_HOSTNAME }} |
| 61 | + apikey: ${{ secrets.DEPENDENCYTRACK_APIKEY }} |
| 62 | + projectname: "Attollo" |
| 63 | + projectversion: ${{ env.VERSION }} |
| 64 | + projecttags: 'bukkit,paper,plugin' |
| 65 | + bomfilename: "build/reports/cyclonedx/bom.xml" |
| 66 | + autocreate: true |
| 67 | + parent: 'becbe738-ef2b-4333-bd13-477ab794d76a' |
0 commit comments