Skip to content

add push job

add push job #36

Workflow file for this run

name: Publish
on:
push:
jobs:
detect_changes:
runs-on: ubuntu-latest
outputs:
outputs:
lega-commander: ${{ steps.changes.outputs.lega-commander }}
e2eTests: ${{ steps.changes.outputs.e2eTests }}
clearinghouse: ${{ steps.changes.outputs.clearinghouse }}
crypt4gh: ${{ steps.changes.outputs.crypt4gh }}
tsd-file-api-client: ${{ steps.changes.outputs.tsd-file-api-client }}
cega-mock: ${{ steps.changes.outputs.cega-mock }}
localega-tsd-proxy: ${{ steps.changes.outputs.localega-tsd-proxy }}
mq-interceptor: ${{ steps.changes.outputs.mq-interceptor }}
tsd-api-mock: ${{ steps.changes.outputs.tsd-api-mock }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
lega-commander:
- 'cli/lega-commander/**'
e2eTests:
- 'e2eTests/**'
clearinghouse:
- 'lib/clearinghouse/**'
crypt4gh:
- 'lib/crypt4gh/**'
tsd-file-api-client:
- 'lib/tsd-file-api-client/**'
cega-mock:
- 'services/cega-mock/**'
localega-tsd-proxy:
- 'services/localega-tsd-proxy/**'
mq-interceptor:
- 'services/mq-interceptor/**'
tsd-api-mock:
- 'services/tsd-api-mock/**'
release_fega_norway:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/[email protected]
- name: Get current version of fega-norway
id: version_fega-norway
run: |
FEGA_NORWAY_VERSION=$(grep -oP 'version = "\K[0-9]+\.[0-9]+\.[0-9]+' build.gradle.kts)
echo "fega-norway_version=$FEGA_NORWAY_VERSION" >> $GITHUB_OUTPUT
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: ${{ steps.version_fega-norway.outputs.fega-norway_version }}
prerelease: false
name: "FEGA Norway-${{ steps.version_fega-norway.outputs.fega-norway_version }}"
publish-clearinghouse:
needs: detect_changes
if: needs.detect_changes.outputs.clearinghouse == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/[email protected]
- name: Get current version for clearinghouse
id: version_clearinghouse
run: |
CLEARINGHOUSE_VERSION=$(grep -oP 'version = "\K[0-9]+\.[0-9]+\.[0-9]+' lib/clearinghouse/build.gradle.kts)
echo "clearinghouse_version=$CLEARINGHOUSE_VERSION" >> $GITHUB_OUTPUT
- name: Bump patch version for clearinghouse
id: bump_clearinghouse_version
run: |
CLEARINGHOUSE_VERSION="${{ steps.version_clearinghouse.outputs.clearinghouse_version }}"
VERSION_PARTS=(${CLEARINGHOUSE_VERSION//./ })
MAJOR=${VERSION_PARTS[0]}
MINOR=${VERSION_PARTS[1]}
PATCH=${VERSION_PARTS[2]}
# Increment the patch version
PATCH=$((PATCH + 1))
NEW_CLEARINGHOUSE_VERSION="$MAJOR.$MINOR.$PATCH"
echo "new_clearinghouse_version=$NEW_CLEARINGHOUSE_VERSION" >> $GITHUB_OUTPUT
- name: Update version in clearinghouse's build.gradle.kts
run: sed -i "s#version = \".*\"#version = \"${{ steps.bump_clearinghouse_version.outputs.new_clearinghouse_version }}\"#" lib/clearinghouse/build.gradle.kts
- name: Release clearinghouse
run: |
./gradlew :lib:clearinghouse:build
./gradlew :lib:clearinghouse:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Check failure on line 121 in .github/workflows/package.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/package.yml

Invalid workflow file

You have an error in your yaml syntax on line 121
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# BRANCH_NAME=${{ github.head_ref }}
BRANCH_NAME=${{ github.ref_name }}
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add -A
git commit -m "bump clearinghouse version to ${{ steps.bump_clearinghouse_version.outputs.new_clearinghouse_version }}"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/ELIXIR-NO/FEGA-Norway.git HEAD:refs/heads/$BRANCH_NAME
- name: Create GitHub release
if: success()
uses: softprops/action-gh-release@v2
with:
target_commitish: ${{ github.head_ref || github.ref_name }}
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "clearinghouse-${{ steps.bump_clearinghouse_version.outputs.new_clearinghouse_version }}"
prerelease: false
name: "Clearinghouse-${{ steps.bump_clearinghouse_version.outputs.new_clearinghouse_version }}"
publish-crypt4gh:
needs: detect_changes
if: needs.detect_changes.outputs.crypt4gh == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/[email protected]
- name: Get current version for crypt4gh
id: version_crypt4gh
run: |
CRYPT4GH_VERSION=$(grep -oP 'version = "\K[0-9]+\.[0-9]+\.[0-9]+' lib/crypt4gh/build.gradle.kts)
echo "crypt4gh_version=$CRYPT4GH_VERSION" >> $GITHUB_OUTPUT
- name: Bump patch version for crypt4gh
id: bump_crypt4gh_version
run: |
CRYPT4GH_VERSION="${{ steps.version_crypt4gh.outputs.crypt4gh_version }}"
VERSION_PARTS=(${CRYPT4GH_VERSION//./ })
MAJOR=${VERSION_PARTS[0]}
MINOR=${VERSION_PARTS[1]}
PATCH=${VERSION_PARTS[2]}
# Increment the patch version
PATCH=$((PATCH + 1))
NEW_CRYPT4GH_VERSION="$MAJOR.$MINOR.$PATCH"
echo "new_crypt4gh_version=$NEW_CRYPT4GH_VERSION" >> $GITHUB_OUTPUT
- name: Update version in crypt4gh's build.gradle.kts
run: sed -i "s#version = \".*\"#version = \"${{ steps.bump_crypt4gh_version.outputs.new_crypt4gh_version }}\"#" lib/crypt4gh/build.gradle.kts
- name: Release crypt4gh
run: |
./gradlew :lib:crypt4gh:build
./gradlew :lib:crypt4gh:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# BRANCH_NAME=${{ github.head_ref }}
BRANCH_NAME=${{ github.ref_name }}
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add -A
git commit -m "bump crypt4gh version to ${{ steps.bump_crypt4gh_version.outputs.new_crypt4gh_version }}"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/ELIXIR-NO/FEGA-Norway.git HEAD:refs/heads/$BRANCH_NAME
- name: Create GitHub release
if: success()
uses: softprops/action-gh-release@v2
with:
target_commitish: ${{ github.head_ref || github.ref_name }}
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "crypt4gh-${{ steps.bump_crypt4gh_version.outputs.new_crypt4gh_version }}"
prerelease: false
name: "Crypt4gh-${{ steps.bump_crypt4gh_version.outputs.new_crypt4gh_version }}"
publish-tsd-file-api-client:
needs: detect_changes
if: needs.detect_changes.outputs.tsd-file-api-client == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/[email protected]
- name: Get current version for tsd-file-api-client
id: version_tsd-file-api-client
run: |
TSD_FILE_API_CLIENT_VERSION=$(grep -oP 'version = "\K[0-9]+\.[0-9]+\.[0-9]+' lib/tsd-file-api-client/build.gradle.kts)
echo "tsd-file-api-client_version=$TSD_FILE_API_CLIENT_VERSION" >> $GITHUB_OUTPUT
- name: Bump patch version for tsd-file-api-client
id: bump_tsd-file-api-client_version
run: |
TSD_FILE_API_CLIENT_VERSION="${{ steps.version_tsd-file-api-client.outputs.tsd-file-api-client_version }}"
VERSION_PARTS=(${TSD_FILE_API_CLIENT_VERSION//./ })
MAJOR=${VERSION_PARTS[0]}
MINOR=${VERSION_PARTS[1]}
PATCH=${VERSION_PARTS[2]}
# Increment the patch version
PATCH=$((PATCH + 1))
NEW_TSD_FILE_API_CLIENT_VERSION="$MAJOR.$MINOR.$PATCH"
echo "new_tsd-file-api-client_version=$NEW_TSD_FILE_API_CLIENT_VERSION" >> $GITHUB_OUTPUT
- name: Update version in tsd-file-api-client's build.gradle.kts
run: sed -i "s#version = \".*\"#version = \"${{ steps.bump_tsd-file-api-client_version.outputs.new_tsd-file-api-client_version }}\"#" lib/tsd-file-api-client/build.gradle.kts
- name: Release tsd-file-api-client
run: |
./gradlew :lib:tsd-file-api-client:build
./gradlew :lib:tsd-file-api-client:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# BRANCH_NAME=${{ github.head_ref }}
BRANCH_NAME=${{ github.ref_name }}
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add -A
git commit -m "bump tsd-file-api-client version to ${{ steps.bump_tsd-file-api-client_version.outputs.new_tsd-file-api-client_version }}"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/ELIXIR-NO/FEGA-Norway.git HEAD:refs/heads/$BRANCH_NAME
- name: Create GitHub release
if: success()
uses: softprops/action-gh-release@v2
with:
target_commitish: ${{ github.head_ref || github.ref_name }}
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "tsd-file-api-client-${{ steps.bump_tsd-file-api-client_version.outputs.new_tsd-file-api-client_version }}"
prerelease: false
name: "Tsd-file-api-client-${{ steps.bump_tsd-file-api-client_version.outputs.new_tsd-file-api-client_version }}"