Skip to content

docs: add contributing link to readme file (#2596) #506

docs: add contributing link to readme file (#2596)

docs: add contributing link to readme file (#2596) #506

#################################################################################
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://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.
#
# SPDX-License-Identifier: Apache-2.0
#################################################################################
name: "Generate DEPENDENCIES file and publish to GitHub pages"
on:
workflow_dispatch:
push:
branches:
- main
- release/*
permissions:
contents: write
jobs:
check-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-java
- name: Output release type
id: release_type
shell: bash
run: |
VERSION=$(grep "version" gradle.properties | awk -F= '{print $2}')
IFS=.- read -r MAJOR MINOR PATCH SNAPSHOT<<<"$VERSION"
if [[ ! -z $SNAPSHOT ]] then
echo "is_official_release=false" >> "$GITHUB_OUTPUT"
else
echo "is_official_release=true" >> "$GITHUB_OUTPUT"
fi
- uses: ./.github/actions/generate-and-check-dependencies
with:
run: ${{ steps.release_type.outputs.is_official_release == 'true' && 'strict' || 'standard' }}
- name: Prepare to publish
if: ${{ github.ref_name == 'main' }}
shell: bash
run: |
mkdir public
cp DEPENDENCIES public/
- name: Publish to GitHub Pages
if: ${{ github.ref_name == 'main' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: public
keep_files: true
- name: Replace published DEPENDENCIES file link in NOTICE with the one just created
if: ${{ startsWith(github.ref_name, 'release/') }}
run: sed -i "s#\[DEPENDENCIES\]\(.*\)#\[DEPENDENCIES\]\(DEPENDENCIES\)#g" NOTICE.md
- name: Commit DEPENDENCIES changes
if: ${{ startsWith(github.ref_name, 'release/') }}
shell: bash
run: |
if git diff --quiet -- DEPENDENCIES; then
echo "No changes in DEPENDENCIES, skipping commit."
exit 0
fi
git add DEPENDENCIES
git config user.name "eclipse-tractusx-bot"
git config user.email "tractusx-bot@eclipse.org"
git commit --message "Update DEPENDENCIES file"
git push origin ${{ github.ref_name }}
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT