Skip to content

Commit

Permalink
Merge pull request #1 from Dpbm/fix-gh-action
Browse files Browse the repository at this point in the history
Fix actions
  • Loading branch information
Dpbm authored Dec 9, 2023
2 parents ec8da1d + 838ea40 commit 467d0d4
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 54 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test and build
on:
push:
branches: ["*"]

jobs:
test_build:
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v3

- name: Setup java
uses: actions/setup-java@v3
with:
java-version: "8"
distribution: "temurin"

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run tests
run: ./gradlew test

- name: Run build with Gradle Wrapper
run: ./gradlew build
36 changes: 0 additions & 36 deletions .github/workflows/gh.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ replay_pid*

# End of https://www.toptal.com/developers/gitignore/api/java

.secrets
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"Javadoc",
"kotlin",
"opensuse",
"OSSRH",
"temurin",
"turing"
],
Expand Down
17 changes: 0 additions & 17 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,6 @@ publishing {
}

repositories{
maven {
name = "Sonatype"
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_TOKEN")
}
}

maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/Dpbm/turing-machine")
Expand All @@ -97,12 +86,6 @@ signing {
sign(publishing.publications["turing-machine"])
}

tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}

tasks.jar {
manifest {
attributes(mapOf("Implementation-Title" to project.name,
Expand Down
27 changes: 26 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A java library to simulate turing machines using automatons.

![gh workflow](https://github.com/Dpbm/turing-machine/actions/workflows/gh.yml/badge.svg)
![actions workflow](https://github.com/Dpbm/turing-machine/actions/workflows/build_test.yml/badge.svg)

---

Expand Down Expand Up @@ -213,6 +213,31 @@ You can also build the project by your own, using:
./gradlew build
```

## Publishing

To publish this package to a github package, you need to add a `classic token` to you account, and grant the access to read and write packages, to do that take a look at: [github article](https://docs.github.com/en/actions/publishing-packages/publishing-java-packages-with-gradle).

After that, export the `GH_USERNAME` and the `GH_TOKEN` to your environment variables, like:

```bash
export GH_USERNAME="username"
export GH_TOKEN="gh_token"
```

Also, you'll need a `GPG` key to sign the package, follow [the official instructions](https://docs.gradle.org/current/userguide/signing_plugin.html) to ensure that.

Then, run the `gradle publish` to publish to gh packages.

```bash
./gradlew publish
```

alternatively, you can pass the variables along with the `gradlew` command:

```bash
GH_USERNAME="username" GH_TOKEN="gh_token" ./gradlew publish
```

## Contributing

If you want to help this project, feel free to create an issue, make some PRs and text with some other contributors at this repo.
Expand Down

0 comments on commit 467d0d4

Please # to comment.