Skip to content

Commit

Permalink
Update release-v2.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yvasyliev authored Nov 15, 2023
1 parent 407a949 commit 65850f1
Showing 1 changed file with 44 additions and 27 deletions.
71 changes: 44 additions & 27 deletions .github/workflows/release-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,22 @@ on:
- provided

jobs:
perform-tests:
get-artifact-id:
runs-on: ubuntu-latest
environment: Test
if: false #TODO: remove if
outputs:
artifact-id: ${{ steps.get-artifact-id.outputs.artifact-id }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
cache: maven
- name: Build with Maven
env:
REDDIT_SUBREDDIT: ${{ secrets.REDDIT_SUBREDDIT }}
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }}
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }}
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }}
REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }}
SPRING_JPA_HIBERNATE_DDL_AUTO: ${{ vars.SPRING_JPA_HIBERNATE_DDL_AUTO }}
TELEGRAM_ADMIN_ID: ${{ secrets.TELEGRAM_ADMIN_ID }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_BOT_USERNAME: ${{ secrets.TELEGRAM_BOT_USERNAME }}
TELEGRAM_CHANNEL_ID: ${{ secrets.TELEGRAM_CHANNEL_ID }}
TELEGRAM_CHANNEL_NAME: ${{ secrets.TELEGRAM_CHANNEL_NAME }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
TELEGRAM_SCHEDULE_POSTING_ENABLED: ${{ vars.TELEGRAM_SCHEDULE_POSTING_ENABLED }}
run: mvn test
uses: actions/checkout@v4
- name: Get artifactId
id: get-artifact-id
run: |
sudo apt-get install xmlstarlet
artifact_id=$(xmlstarlet sel -N pom=http://maven.apache.org/POM/4.0.0 -t -v "/pom:project/pom:artifactId" pom.xml)
echo "\`artifactId\` is \`$artifact_id\`" >> $GITHUB_STEP_SUMMARY
artifact_id="artifact-id=$artifact_id"
echo "$artifact_id"
echo "$artifact_id" >> "$GITHUB_OUTPUT"
get-current-version:
runs-on: ubuntu-latest
Expand All @@ -67,10 +54,40 @@ jobs:
steps:
- name: Validate current version
env:
CURRENT_VERSION: 1.2.3-a
CURRENT_VERSION: ${{ steps.get-current-version.outputs.current-version }}
run: |
if [[ ! $CURRENT_VERSION =~ ^([[:digit:]]+\.){2}[[:digit:]]+([\.-].+)?$ ]]
then
echo "::error::Unexpected artifact version found in pom.xml: $CURRENT_VERSION. Expected format: x.y.z*"
exit 1
fi
perform-tests:
runs-on: ubuntu-latest
environment: Test
if: false #TODO: remove if
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
cache: maven
- name: Build with Maven
env:
REDDIT_SUBREDDIT: ${{ secrets.REDDIT_SUBREDDIT }}
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }}
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }}
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }}
REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }}
SPRING_JPA_HIBERNATE_DDL_AUTO: ${{ vars.SPRING_JPA_HIBERNATE_DDL_AUTO }}
TELEGRAM_ADMIN_ID: ${{ secrets.TELEGRAM_ADMIN_ID }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_BOT_USERNAME: ${{ secrets.TELEGRAM_BOT_USERNAME }}
TELEGRAM_CHANNEL_ID: ${{ secrets.TELEGRAM_CHANNEL_ID }}
TELEGRAM_CHANNEL_NAME: ${{ secrets.TELEGRAM_CHANNEL_NAME }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
TELEGRAM_SCHEDULE_POSTING_ENABLED: ${{ vars.TELEGRAM_SCHEDULE_POSTING_ENABLED }}
run: mvn test

0 comments on commit 65850f1

Please sign in to comment.