6.0.0 #29
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload Release | |
on: | |
release: | |
types: published | |
jobs: | |
upload: | |
name: Upload | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache Local Maven Repository | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
- name: Setup Maven Central | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 8.0.292+10 | |
distribution: 'adopt' | |
server-id: ossrh | |
server-username: MAVEN_CENTRAL_USERNAME | |
server-password: MAVEN_CENTRAL_TOKEN | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Publish to Maven Central | |
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-maven-central | |
env: | |
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Setup GitHub Packages | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 8.0.292+10 | |
distribution: 'adopt' | |
- name: Publish to GitHub Packages | |
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-github-packages | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pack RPM | |
run: cd rpm/ && mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= -f rpm.pom.xml package | |
- name: Create helm package | |
run: helm package --version=${{ github.event.release.tag_name }} --app-version=${{ github.event.release.tag_name }} k8s_01/ | |
- name: Attach rpm to release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
rpm/target/rpm/com.teragrep-k8s_01/RPMS/noarch/com.teragrep-k8s_01-*.noarch.rpm | |
k8s_01-*.tgz | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2.5.0 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2.1.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Lowercase repository name | |
run: echo "REPO_LC=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV | |
- name: 'Build Image' | |
run: | | |
docker buildx build --output type=docker --tag ghcr.io/${{ env.REPO_LC }}:${{ github.event.release.tag_name }} --tag ghcr.io/${{ env.REPO_LC }}:latest . | |
docker push ghcr.io/${{ env.REPO_LC }} --all-tags |