Skip to content

Commit

Permalink
Update PUBLISH.md and Fix github action
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioPinheiro committed May 16, 2023
1 parent 6b18eff commit 93f6216
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ name: CI
on:
workflow_dispatch:
inputs:
make_release:
description: "Publish the libraries (make a release)"
make_snapshot_release:
description: "Publish libraries's SNAPSHOT"
default: false
type: boolean
required: false
pull_request:
branches-ignore:
- "gh-pages"
push:
branches:
- "master"
branches: [master, main]
tags: ["v*"]

jobs:
Run-Tests:
Expand All @@ -25,7 +25,7 @@ jobs:
with:
fetch-depth: 0 # Needed for the release tag // `git fetch --tags` will also work
- name: Setup Java and Scala
uses: olafurpg/setup-scala@v13
uses: olafurpg/setup-scala@v14
- name: Setup Node
uses: actions/setup-node@v2
with:
Expand All @@ -40,7 +40,7 @@ jobs:
# NODE_OPTIONS: "--openssl-legacy-provider"

- name: Release
if: (inputs.make_release == true) && (github.ref_name == 'master')
if: ((inputs.make_snapshot_release == true) && (github.ref_name == 'master') || startsWith(github.ref, 'refs/tags/v'))
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
Expand Down
15 changes: 8 additions & 7 deletions PUBLISH.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ gpg --keyserver hkp://keyserver.ubuntu.com --send-key $LONG_ID && \

### Config CI

**GitHub action** - `.github/workflows/ci.yml` but need to set the agr `make_release` to true
`SONATYPE_PASSWORD` - The password you use to log into https://s01.oss.sonatype.org/
`SONATYPE_USERNAME` - The username you use to log into https://s01.oss.sonatype.org
`PGP_SECRET` - The base64 encoded secret of your private key
**GitHub action** after pushing a tag (started with 'v') the action `.github/workflows/ci.yml` will try to make a release (Publish to the libraries to Sonatype).
For `SNAPSHOT` call the action manual with the flag `make_snapshot_release` set to true.

Job's ENV notes:
- `SONATYPE_PASSWORD` - The password you use to log into https://s01.oss.sonatype.org/
- `SONATYPE_USERNAME` - The username you use to log into https://s01.oss.sonatype.org
- `PGP_SECRET` - The base64 encoded secret of your private key

### Run ci-release Local


Expand All @@ -65,6 +69,3 @@ Even if the project is open source you need a GitHub account to download the pac

The Library was also published to github `https://maven.pkg.github.com/FabioPinheiro/scala-did`.

**GitHub action** - `.github/workflows/ci.yml` but need to set the agr `make_release` to true
`PACKAGES_GITHUB_TOKEN`

0 comments on commit 93f6216

Please sign in to comment.