Skip to content

Commit

Permalink
ci: technology release: change version before publishing artifacts (#148
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ndr-brt authored Nov 7, 2024
1 parent 9e9167b commit ef8bdcf
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions .github/workflows/technology-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,34 @@ on:

jobs:

Publish-Artefacts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: eclipse-edc/.github/.github/actions/publish-maven-artifacts@main
with:
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }}
osshr-username: ${{ secrets.ORG_OSSRH_USERNAME }}
osshr-password: ${{ secrets.ORG_OSSRH_PASSWORD }}

Create-Tag:
needs: [ Publish-Artefacts ]
Release:
runs-on: ubuntu-latest
outputs:
TAG: ${{ steps.set-tag.outputs.TAG }}
steps:
- uses: actions/checkout@v4

- id: set-version
run: |
VERSION=$(echo ${{ github.ref_name }} | cut -d '/' -f 2)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- uses: eclipse-edc/.github/.github/actions/set-project-version@main
with:
version: ${{ steps.set-version.outputs.VERSION }}

- uses: eclipse-edc/.github/.github/actions/publish-maven-artifacts@main
with:
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }}
osshr-username: ${{ secrets.ORG_OSSRH_USERNAME }}
osshr-password: ${{ secrets.ORG_OSSRH_PASSWORD }}

- shell: bash
id: set-tag
run: |
git config user.name "eclipse-edc-bot"
git config user.email "edc-bot@eclipse.org"
TAG=v${{ steps.set-version.outputs.VERSION }}
git add .
Expand All @@ -47,7 +44,7 @@ jobs:
echo "TAG=$TAG" >> $GITHUB_OUTPUT
Create-GitHub-Release:
needs: [ Create-Tag ]
needs: [ Release ]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -62,7 +59,7 @@ jobs:
removeArtifacts: true

Post-To-Discord:
needs: [ Publish-Artefacts, Create-Tag, Create-GitHub-Release ]
needs: [ Release, Create-GitHub-Release ]
if: "always()"
runs-on: ubuntu-latest
steps:
Expand All @@ -71,8 +68,7 @@ jobs:
with:
webhook: ${{ secrets.DISCORD_GITHUB_CI_WEBHOOK }}
# if the publishing is skipped, that means the preceding test run failed
status: ${{ needs.Publish-Artefacts.result }}
title: "Release ${{ github.repository }}"
description: "Build and publish ${{ needs.Create-Tag.outputs.TAG }}"
status: ${{ needs.Release.result }}
title: "Release ${{ github.repository }} ${{ needs.Release.outputs.TAG }}"
username: GitHub Actions

0 comments on commit ef8bdcf

Please sign in to comment.