Skip to content

Add JReleaser #58

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

Merged
merged 1 commit into from
Apr 3, 2022
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
File renamed without changes.
13 changes: 0 additions & 13 deletions .github/workflows/greetings.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/release-actions.yml

This file was deleted.

95 changes: 95 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: "Release version"
required: true
next:
description: "Next version"
required: false

jobs:
version:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-java@v2
with:
java-version: 11
distribution: temurin
- name: Set release version
id: version
run: |
RELEASE_VERSION=${{ github.event.inputs.version }}
NEXT_VERSION=${{ github.event.inputs.next }}
PLAIN_VERSION=`echo ${RELEASE_VERSION} | awk 'match($0, /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)/) { print substr($0, RSTART, RLENGTH); }'`
COMPUTED_NEXT_VERSION="${PLAIN_VERSION}-SNAPSHOT"
if [ -z $NEXT_VERSION ]
then
NEXT_VERSION=$COMPUTED_NEXT_VERSION
fi
./mvnw -B versions:set versions:commit -DnewVersion=$RELEASE_VERSION
git config --global user.email "project.openubl.preview.bot@gmail.com"
git config --global user.name "Project-Openubl Bot"
git commit -a -m "🏁 Releasing version $RELEASE_VERSION"
git push origin HEAD:master
git rev-parse HEAD > HEAD
echo $RELEASE_VERSION > RELEASE_VERSION
echo $PLAIN_VERSION > PLAIN_VERSION
echo $NEXT_VERSION > NEXT_VERSION
- name: Upload version files
uses: actions/upload-artifact@v2
with:
name: artifacts
path: |
HEAD
*_VERSION

release:
needs: [ version ]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: artifacts
path: artifacts
- name: Read HEAD ref
id: head
uses: juliangruber/read-file-action@v1
with:
path: artifacts/HEAD
- uses: actions/checkout@v2
with:
ref: ${{ steps.head.outputs.content }}

- name: Release with JReleaser
uses: jreleaser/release-action@v2
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_PROJECT_VERSION: ${{ steps.version.outputs.RELEASE_VERSION }}
JRELEASER_ZULIP_API_KEY: ${{ secrets.JRELEASER_ZULIP_API_KEY }}
JRELEASER_TWITTER_CONSUMER_KEY: ${{ secrets.JRELEASER_TWITTER_CONSUMER_KEY }}
JRELEASER_TWITTER_CONSUMER_SECRET: ${{ secrets.JRELEASER_TWITTER_CONSUMER_SECRET }}
JRELEASER_TWITTER_ACCESS_TOKEN: ${{ secrets.JRELEASER_TWITTER_ACCESS_TOKEN }}
JRELEASER_TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.JRELEASER_TWITTER_ACCESS_TOKEN_SECRET }}
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.gpg_private_key }}
gpg_passphrase: ${{ secrets.gpg_passphrase }}
nexus_username: ${{ secrets.nexus_username }}
nexus_password: ${{ secrets.nexus_password }}
- name: Set next version
env:
NEXT_VERSION: ${{ steps.version.outputs.NEXT_VERSION }}
run: |
./mvnw -B versions:set versions:commit -DnewVersion=$NEXT_VERSION
git config --global user.email "project.openubl.preview.bot@gmail.com"
git config --global user.name "Project-Openubl Bot"
git commit -a -m "⬆️ Next version $NEXT_VERSION"
git push origin HEAD:master
51 changes: 51 additions & 0 deletions jreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
# and other contributors as indicated by the @author tags.
#
# Licensed under the Apache License - 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

project:
name: xbuilder
description: Crea XMLs basados en UBL 2.1 y las especificaciones de SUNAT, Perú.
longDescription: Consulta el DNI o RUC de cualquier persona natural o jurídica registrada en el territorio peruano. La información es obtenida del padrón reducido de la SUNAT.
website: https://project-openubl.github.io/
authors:
- Carlos E. Feria Vila
license: Apache-2
java:
groupId: io.github.project-openubl
version: 11
extraProperties:
inceptionYear: 2019

release:
github:
owner: project-openubl
name: xbuilder
branch: master
overwrite: true
discussionCategoryName: Announcements

announce:
zulip:
active: RELEASE
account: carlosthe19916@gmail.com
apiHost: https://projectopenubl.zulipchat.com/api/v1
channel: announcements
subject: '{{projectNameCapitalized}} {{projectVersion}} released!'
message: '🚀 {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}'
twitter:
active: RELEASE
status: '🚀 {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}'

6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@
<version>5.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.3.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
Expand Down