#Github action jar release
1 messages · Page 1 of 1 (latest)
<@&987246554085740594> please have a look, thanks.
Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
To upload the jars to a release on GitHub using GitHub Actions, you can create a workflow YAML file in your repository. Here's an example of what the workflow file might look like:
name: Release Jar Files
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build Jars
run: ./gradlew build
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v1.0.0
release_name: Release v1.0.0
draft: false
prerelease: false
- name: Upload Jar Files
id: upload_jars
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/libs/*.jar
asset_name: my-jar-file.jar
This workflow will trigger on pushes to the main branch, build your jars using Gradle, create a new release on GitHub, and then upload all jar files from the build/libs/ directory to that release.
Make sure to replace tag_name, release_name, and asset_name with appropriate values for your project. Also, ensure that you have set up appropriate permissions for the GitHub token in your repository's secrets.
i know you can use github artifacts to publish privately into a github artifact store. you can view it from the workflow run details