make github actions build artifact public

https://github.com/asdru22/Game2D/actions/runs/12453995171 i have a jar that is built that i can download. however, only i can download it. how can i change it so that anyone can download it?
GitHub
release artifact test · asdru22/Game2D@7be1121
Java 2d Game. Contribute to asdru22/Game2D development by creating an account on GitHub.
14 Replies
JavaBot
JavaBot5d ago
This post has been reserved for your question.
Hey @asdru! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
asdru
asdruOP5d ago
GitHub
Game2D/.github/workflows/maven.yml at master · asdru22/Game2D
Java 2d Game. Contribute to asdru22/Game2D development by creating an account on GitHub.
Defective
Defective5d ago
All logged in users should be able to download build artifacts
asdru
asdruOP5d ago
Ohh ok But what if I wanted to make it a release I mean change the yaml file so that it automatically publishes the artifact as a release
dan1st
dan1st5d ago
add it as a release artifact i.e. you upload it to the release
asdru
asdruOP5d ago
i know how to do that manually, but i was hoping to find a way to automate the process? push->build jar->upload jar as release
dan1st
dan1st5d ago
yeah, GH actions can do that you could automatically invoke a workflow whenever you create a release or do something like let GH actions create a release including the artifact every time you push
asdru
asdruOP5d ago
yeah that'd be ideal, i tried messing with the yml file but could figure out how
dan1st
dan1st5d ago
GitHub
GitHub - softprops/action-gh-release: 📦 GitHub Action for creating ...
📦 :octocat: GitHub Action for creating GitHub Releases - GitHub - softprops/action-gh-release: 📦 GitHub Action for creating GitHub Releases
asdru
asdruOP5d ago
name: Java CI with Maven

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'oracle'
- run: mvn --batch-mode --update-snapshots verify
- run: mkdir staging && cp target/*.jar staging
- uses: actions/upload-artifact@v4
with:
name: Runnable Jar
path: staging
name: Java CI with Maven

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'oracle'
- run: mvn --batch-mode --update-snapshots verify
- run: mkdir staging && cp target/*.jar staging
- uses: actions/upload-artifact@v4
with:
name: Runnable Jar
path: staging
how can i merge it with this 😅
dan1st
dan1st5d ago
? you just add another step
asdru
asdruOP5d ago
- name: Build
run: echo ${{ github.sha }} > Release.txt
- name: Test
run: cat Release.txt
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: Release.txt
- name: Build
run: echo ${{ github.sha }} > Release.txt
- name: Test
run: cat Release.txt
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: Release.txt
this part?
dan1st
dan1st5d ago
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') }}
with:
body: This is your body here
files: staging/*.jar
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') }}
with:
body: This is your body here
files: staging/*.jar
something like that well you don't want to upload Release.txt, right? and I don't think you want to only do it on pushing tags
JavaBot
JavaBot4d ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?