Skip to content

Commit 9037c4e

Browse files
author
Pedro Pablo Bustamante Barrera
committed
chore: add publish action
1 parent 316d186 commit 9037c4e

File tree

4 files changed

+53
-9
lines changed

4 files changed

+53
-9
lines changed

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
name: Publish
7+
8+
on:
9+
release:
10+
types: [ "created" ]
11+
branches: [ "main" ]
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
publish:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set up JDK 21
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: '21'
25+
distribution: 'temurin'
26+
cache: 'sbt'
27+
- uses: sbt/setup-sbt@v1
28+
- name: Publish package
29+
run: sbt test publish
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/scala.yml renamed to .github/workflows/test.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# separate terms of service, privacy policy, and support
44
# documentation.
55

6-
name: CI
6+
name: Test
77

88
on:
99
push:
@@ -16,9 +16,7 @@ permissions:
1616

1717
jobs:
1818
build:
19-
2019
runs-on: ubuntu-latest
21-
2220
steps:
2321
- uses: actions/checkout@v4
2422
- name: Set up JDK 21
@@ -29,7 +27,4 @@ jobs:
2927
cache: 'sbt'
3028
- uses: sbt/setup-sbt@v1
3129
- name: Run tests with SBT
32-
run: sbt test
33-
# Optional: This step uploads information to the GitHub dependency graph and unblocking Dependabot alerts for the repository
34-
# - name: Upload dependency graph
35-
# uses: scalacenter/sbt-dependency-submission@ab086b50c947c9774b70f39fc7f6e20ca2706c91
30+
run: sbt test

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# scala-stdnum
22

3-
[![CI](https://github.com/ppbustamante/scala-stdnum/actions/workflows/scala.yml/badge.svg)](https://github.com/ppbustamante/scala-stdnum/actions/workflows/scala.yml)
3+
[![Testing](https://github.com/ppbustamante/scala-stdnum/actions/workflows/test.yml/badge.svg)](https://github.com/ppbustamante/scala-stdnum/actions/workflows/test.yml)
44

55
A Scala library to parse, validate and reformat standard numbers and codes in different formats. It contains a large
66
collection of number formats.

build.sbt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
ThisBuild / organization := "cl.mixin"
22
ThisBuild / scalaVersion := "3.3.5"
3-
ThisBuild / version := "1.0.0-SNAPSHOT"
3+
ThisBuild / version := "1.0.0"
4+
ThisBuild / versionScheme := Some("semver-spec")
5+
6+
ThisBuild / homepage := Some(url("https://github.com/ppbustamante/scala-stdnum"))
7+
ThisBuild / licenses := Seq(
8+
"LICENSE" -> url("https://github.com/ppbustamante/scala-stdnum/blob/main/LICENSE")
9+
)
10+
ThisBuild / publishMavenStyle := true
11+
ThisBuild / pomIncludeRepository := { _ => false }
12+
13+
ThisBuild / publishTo := Some(
14+
"GitHub ppbustamante Apache Maven Packages" at "https://maven.pkg.github.com/ppbustamante/scala-stdnum"
15+
)
16+
ThisBuild / credentials += Credentials(
17+
"GitHub Package Registry",
18+
"maven.pkg.github.com",
19+
"ppbustamante",
20+
System.getenv("GITHUB_TOKEN")
21+
)
422

523
lazy val root = project
624
.in(file("."))

0 commit comments

Comments
 (0)