Skip to content

Commit 26beab8

Browse files
authored
github package publishing (#54)
1 parent 601290f commit 26beab8

4 files changed

Lines changed: 59 additions & 3 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- uses: actions/upload-artifact@v4
2020
with:
2121
name: headford68k-binsrc-SNAPSHOT-${{ github.sha }}-${{ github.run_number }}
22-
path: build/dist
22+
path: build/dist
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# GitHub recommends pinning actions to a commit SHA.
7+
# To get a newer version, you will need to update the SHA.
8+
# You can also reference a tag or branch, but the action may change without warning.
9+
10+
name: Publish package to GitHub Packages
11+
on: [push]
12+
# release:
13+
# types: [created]
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-java@v4
23+
with:
24+
java-version: '17'
25+
distribution: 'zulu'
26+
- name: Setup Gradle
27+
uses: gradle/actions/setup-gradle@v4
28+
29+
- name: Publish package
30+
run: ./gradlew jarWithSources publish
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.gradle

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
plugins {
22
id 'java'
3+
id 'maven-publish'
34
}
45

56
def dateString = getDate()
6-
group 'com.fbdev.helios'
7+
group 'com.fitreb.dev'
78

89
assert JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17) : "Java 17 or newer is required"
910

@@ -15,6 +16,29 @@ repositories {
1516
mavenCentral()
1617
}
1718

19+
publishing {
20+
21+
repositories {
22+
maven {
23+
name = "GitHubPackages"
24+
url = "https://maven.pkg.github.com/fedex81/m68k"
25+
credentials {
26+
username = System.getenv("GITHUB_ACTOR")
27+
password = System.getenv("GITHUB_TOKEN")
28+
}
29+
}
30+
}
31+
32+
publications {
33+
gpr(MavenPublication) {
34+
from components.java
35+
groupId = project.group
36+
artifactId = project.name
37+
version = project.version
38+
}
39+
}
40+
}
41+
1842
sourceSets {
1943
main {
2044
resources {

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
rootProject.name="headford68k"
1+
rootProject.name="m68k-helios"

0 commit comments

Comments
 (0)