mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-01-01 07:27:35 +00:00
[AB-xxx] adding manual release pipeline
This commit is contained in:
57
.github/workflows/release_manual.yml
vendored
Normal file
57
.github/workflows/release_manual.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: Publishes a new version of abstracto
|
||||
on: workflow_dispatch
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: master
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'corretto'
|
||||
java-version: 17
|
||||
- name: Load current version
|
||||
id: version
|
||||
working-directory: ./abstracto-application
|
||||
run: echo "version=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec | cut -d- -f1)" >> $GITHUB_ENV
|
||||
- name: Release maven packages
|
||||
uses: qcastel/github-actions-maven-release@v1.12.41
|
||||
env:
|
||||
JAVA_HOME: /usr/lib/jvm/java-17-openjdk/
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
maven-project-folder: "abstracto-application/"
|
||||
git-release-bot-name: "release-bot"
|
||||
git-release-bot-email: "release-bot@sheldan.dev"
|
||||
release-branch-name: master
|
||||
maven-args: "-Dmaven.javadoc.skip=true -s settings.xml -DskipTests"
|
||||
access-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Login to Harbor
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: harbor.sheldan.dev
|
||||
username: ${{ secrets.HARBOR_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_TOKEN }}
|
||||
- name: Update .env version
|
||||
run:
|
||||
sed -i '2s/.*/VERSION=${{ env.version }}/' .env
|
||||
- name: Load env file
|
||||
id: dotenv
|
||||
uses: falti/dotenv-action@v1.0.4
|
||||
with:
|
||||
path: .env
|
||||
- name: Build and push Docker containers
|
||||
run: docker-compose build && docker-compose push
|
||||
env:
|
||||
REGISTRY_PREFIX: ${{ steps.dotenv.outputs.registry_prefix }}
|
||||
VERSION: ${{ steps.dotenv.outputs.version }}
|
||||
- name: Fix file permissions
|
||||
run:
|
||||
sudo chmod -R ugo+rwX . # https://github.com/actions/checkout/issues/164
|
||||
- name: Commit updated versions
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
author_name: "release-bot"
|
||||
author_email: "release-bot@sheldan.dev"
|
||||
@@ -30,10 +30,11 @@
|
||||
</distributionManagement>
|
||||
|
||||
<scm>
|
||||
<url>https://maven.pkg.github.com/Sheldan/abstracto</url>
|
||||
<developerConnection>scm:git:git@github.com:Sheldan/abstracto.git</developerConnection>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
<connection>scm:git:${project.scm.url}</connection>
|
||||
<developerConnection>scm:git:${project.scm.url}</developerConnection>
|
||||
<url>https://github.com/Sheldan/abstracto.git</url>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
|
||||
19
abstracto-application/settings.xml
Normal file
19
abstracto-application/settings.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
|
||||
http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||
|
||||
<servers>
|
||||
<server>
|
||||
<id>github</id>
|
||||
<configuration>
|
||||
<httpHeaders>
|
||||
<property>
|
||||
<name>Authorization</name>
|
||||
<value>Bearer ${env.GITHUB_TOKEN}</value>
|
||||
</property>
|
||||
</httpHeaders>
|
||||
</configuration>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
||||
Reference in New Issue
Block a user