Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release automation #320

Merged
merged 6 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Snapshot Release

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+-SNAPSHOT
- v[0-9]+.[0-9]+.[0-9]+-[0-9a-zA-Z]+-SNAPSHOT
- v[0-9]+.[0-9]+.[0-9]+-[0-9a-zA-Z]+-[0-9a-zA-Z]+-SNAPSHOT

env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17

- name: Run Unit Tests
run: ./gradlew test
working-directory: efsity-cli

- name: Generate & upload library snapshot artifact AAR (Android Archive) file
run: ./gradlew clean publishMavenPublicationToSonatypeRepository --stacktrace -PSonatypeUsername=${{ secrets.NEXUS_USERNAME }} -PSonatypePassword=${{ secrets.NEXUS_PASSWORD }}
working-directory: efsity-cli

- name: Github Release
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') }}
19 changes: 19 additions & 0 deletions efsity-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,25 @@ SonatypePassword=<your sonatype password>
./gradlew clean publishMavenPublicationToMavenLocal
```

### Snapshot Artifact Releases

To publish an artifact snapshot automatically, all you need to do is push a new tag, which then triggers the CI to generate and publish it. The configuration requires the tag to have a prefix in the glob pattern format:

**v[0-9]+.[0-9]+.[0-9]+[0-9a-zA-Z.-]+-SNAPSHOT**

For example the following are all valid tags that will trigger the generation of a release

v2.0.0-SNAPSHOT

v2.0.0-efsity-SNAPSHOT

v2.0.0-efsity-rc1-SNAPSHOT


_Note_: when creating a tag for efsity version 2.0.0 for example, use the command:

`git tag -a v2.0.0-efsity -s && git push origin v2.0.0-efsity`

### Testing
To run all tests:

Expand Down
Loading