Skip to content

Commit

Permalink
(main) Automate release using GH Actions (#745)
Browse files Browse the repository at this point in the history
* Automate release using GH actions

* Adds release pipeline to do releases from GitHub Action
* Format POMs according to Maven formatting
* Use http endpoints for scm, required to be able to use GITHUB token
  • Loading branch information
abelsromero authored Jan 21, 2024
1 parent b5085fc commit 76b4e50
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 13 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on: workflow_dispatch
permissions:
contents: write

jobs:
release:
environment: release
env:
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- uses: s4u/[email protected]
with:
servers: |
[{
"id": "ossrh",
"username": "${{ secrets.OSS_SONATYPE_USERNAME }}",
"password": "${{ secrets.OSS_SONATYPE_PASSWORD }}"
}]
- name: Configure Git user
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Configure GPG key
run: echo -e "${{ env.GPG_PRIVATE_KEY }}" | gpg --import --batch
- name: Build artifacts
run: ./mvnw clean verify -B -Prelease -Dmaven.test.skip
- name: Publish artifacts
run: ./mvnw release:prepare release:perform -B -Darguments="-Prelease -Dmaven.test.skip"
- name: Close release
run: |
echo "Release completed 🎉"
echo "Remember to 'Close' & 'Release' at https://oss.sonatype.org"
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Build / Infrastructure::
* Use latest Maven Doxia and remove Dependabot exclusion (CI test ensure backward compatibility) (#719)
* Use latest Maven and remove Dependabot exclusion (CI test ensure backward compatibility) (#722)
* Test artifact's signature with Maven in CI (#736)
* Automate release using GH Actions (#141)

Maintenance::
* Replace use of reflection by direct JavaExtensionRegistry calls to register extensions (#596)
Expand Down
3 changes: 1 addition & 2 deletions asciidoctor-converter-doxia-module/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
3 changes: 1 addition & 2 deletions asciidoctor-maven-commons/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
3 changes: 1 addition & 2 deletions asciidoctor-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
3 changes: 1 addition & 2 deletions asciidoctor-parser-doxia-module/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down
9 changes: 4 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.asciidoctor</groupId>
Expand Down Expand Up @@ -57,9 +56,9 @@
</licenses>

<scm>
<url>scm:git:git@github.com:asciidoctor/asciidoctor-maven-plugin.git</url>
<connection>scm:git:git@github.com:asciidoctor/asciidoctor-maven-plugin.git</connection>
<developerConnection>scm:git:git@github.com:asciidoctor/asciidoctor-maven-plugin.git</developerConnection>
<url>scm:git:https://github.com/asciidoctor/asciidoctor-maven-plugin.git</url>
<connection>scm:git:https://github.com/asciidoctor/asciidoctor-maven-plugin.git</connection>
<developerConnection>scm:git:https://github.com/asciidoctor/asciidoctor-maven-plugin.git</developerConnection>
<tag>asciidoctor-maven-plugin-2.2.2</tag>
</scm>

Expand Down

0 comments on commit 76b4e50

Please sign in to comment.