specialization #2159
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
#------------------------------------------------------------- | |
# | |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 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 | |
# | |
# http://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. | |
# | |
#------------------------------------------------------------- | |
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created | |
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path | |
name: Test Release scripts with dry run | |
on: | |
push: | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
# Java setup docs: | |
# https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#installing-custom-java-package-type | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
# tools.jar removed from '9', '11'. see https://openjdk.java.net/jeps/220 | |
java-version: '11' | |
distribution: 'adopt' | |
java-package: 'jdk' | |
- run: printf "JAVA_HOME = $JAVA_HOME \n" | |
- name: Cache local Maven repository | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: gpg key generation - transient | |
run: | | |
printf "HOME: $HOME \n" | |
ls $HOME | |
export GNUPGHOME="$HOME/.gnupg" | |
ls * | |
cat >tempkey <<EOF | |
%echo Generating a basic OpenPGP key | |
Key-Type: DSA | |
Key-Length: 1024 | |
Subkey-Type: ELG-E | |
Subkey-Length: 1024 | |
Name-Real: J143 Bot | |
Name-Comment: This is automation script | |
Name-Email: j143+[bot]@protonmail.com | |
Expire-Date: 0 | |
Passphrase: asdfghjkl | |
# Do a commit here, so that we can later print "done" :-) | |
%commit | |
%echo done | |
EOF | |
gpg --batch --generate-key tempkey | |
sudo cp -rp $HOME/.gnupg $HOME/gnupghome | |
ls $HOME/gnupghome | |
# the last eight digits of the finger print is key id | |
- name: Set the GPG key ID | |
run: | | |
gpg --list-keys | |
GPG_KEY_FINGERPRINT="$(gpg --list-keys | head -n 4 | tail -n 1 | sed 's/^ *//g')" | |
GPG_KEY_ID="${GPG_KEY_FINGERPRINT: (-8)}" | |
- name: Run invoke script | |
run: | | |
cd $GITHUB_WORKSPACE | |
printf "$GITHUB_WORKSPACE --> github workspace\n" | |
export GNUPGHOME="$HOME/gnupghome" | |
gpgconf --kill gpg-agent | |
ls $GNUPGHOME | |
GPG_KEY_FINGERPRINT="$(gpg --list-keys | head -n 4 | tail -n 1 | sed 's/^ *//g')" | |
GPG_KEY_ID="${GPG_KEY_FINGERPRINT: (-8)}" | |
export GPG_KEY=$GPG_KEY_ID | |
bash $GITHUB_WORKSPACE/dev/release/do-release.sh -n -g | |
env: | |
DRY_RUN: '1' | |
GIT_BRANCH: 'main' | |
RELEASE_VERSION: '3.0.0' | |
ASF_USERNAME: 'firstname' | |
GIT_NAME: 'Firstname Lastname' | |
GIT_EMAIL: 'j143+[bot]@protonmail.com' | |
CORRECT_RELEASE_INFO: '1' | |
ASF_PASSWORD: 'asdfghjkl' # wrong password, only to run this workflow | |
GPG_PASSPHRASE: 'asdfghjkl' # wrong passphrase, only to run this workflow | |
# - name: Build with Maven | |
# run: mvn -B package --file pom.xml | |
# - name: Publish to GitHub Packages Apache Maven | |
# run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml | |
# env: | |
# GITHUB_TOKEN: ${{ github.token }} |