Skip to content

Commit

Permalink
Fix publishing
Browse files Browse the repository at this point in the history
The previously used actions where archived
  • Loading branch information
sbrunner committed Sep 13, 2024
1 parent 4f1b0d5 commit 229a244
Showing 1 changed file with 72 additions and 58 deletions.
130 changes: 72 additions & 58 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,66 +167,80 @@ jobs:
- id: version
run: echo "version=$(grep version gradle.properties|sed "s/version=\(.*\)/\1/g")" > $GITHUB_OUTPUT
- run: echo "${{ steps.version.outputs.version }}"

- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ steps.tag.outputs.tag }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/') && env.HAS_SECRETS == 'HAS_SECRETS'
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/libs/print-servlet-${{ steps.version.outputs.version }}.war
asset_name: print-servlet-${{ steps.version.outputs.version }}.war
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/') && env.HAS_SECRETS == 'HAS_SECRETS'
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/distributions/core-${{ steps.version.outputs.version }}.zip
asset_name: print-cli-${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/') && env.HAS_SECRETS == 'HAS_SECRETS'
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/libs/print-lib-${{ steps.version.outputs.version }}.jar
asset_name: print-lib-${{ steps.version.outputs.version }}.jar
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/') && env.HAS_SECRETS == 'HAS_SECRETS'
- name: Upload Release Asset
uses: actions/[email protected]
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/libs/print-lib-${{ steps.version.outputs.version }}-sources.jar
asset_name: print-lib-${{ steps.version.outputs.version }}-sources.jar
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/') && env.HAS_SECRETS == 'HAS_SECRETS'
- name: Upload Release Asset
uses: actions/[email protected]
uses: actions/github-script@v7
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core/build/libs/print-lib-${{ steps.version.outputs.version }}-javadoc.jar
asset_name: print-lib-${{ steps.version.outputs.version }}-javadoc.jar
asset_content_type: application/java-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
script: |-
const fs = require('fs');
const release = await github.request('POST /repos/{owner}/{repo}/releases', {
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: context.ref,
name: '${{ steps.tag.outputs.tag }}',
draft: false,
prerelease: false,
generate_release_notes: false,
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
});
await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
url: release.data.upload_url,
name: "print-servlet-${{ steps.version.outputs.version }}.war",
file: fs.readFileSync("./core/build/libs/print-servlet-${{ steps.version.outputs.version }}.war"),
headers: {
'X-GitHub-Api-Version': '2022-11-28',
'content-type': 'application/java-archive'
},
});
await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
url: release.data.upload_url,
name: "print-cli-${{ steps.version.outputs.version }}.zip",
file: fs.readFileSync("./core/build/distributions/core-${{ steps.version.outputs.version }}.zip"),
headers: {
'X-GitHub-Api-Version': '2022-11-28',
'content-type': 'application/zip'
},
});
await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
url: release.data.upload_url,
name: "print-lib-${{ steps.version.outputs.version }}.jar",
file: fs.readFileSync("./core/build/libs/print-lib-${{ steps.version.outputs.version }}.jar"),
headers: {
'X-GitHub-Api-Version': '2022-11-28',
'content-type': 'application/java-archive'
},
});
await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
url: release.data.upload_url,
name: "print-lib-${{ steps.version.outputs.version }}-sources.jar,
file: fs.readFileSync("./core/build/libs/print-lib-${{ steps.version.outputs.version }}-sources.jar"),
headers: {
'X-GitHub-Api-Version': '2022-11-28',
'content-type': 'application/java-archive'
},
});
await github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
url: release.data.upload_url,
name: "print-lib-${{ steps.version.outputs.version }}-javadoc.jar,
file: fs.readFileSync("./core/build/libs/print-lib-${{ steps.version.outputs.version }}-javadoc.jar"),
headers: {
'X-GitHub-Api-Version': '2022-11-28',
'content-type': 'application/java-archive'
},
});
if: startsWith(github.ref, 'refs/tags/') && env.HAS_SECRETS == 'HAS_SECRETS'

# Update the documentation
Expand Down

0 comments on commit 229a244

Please sign in to comment.