Makefile: make module warnings fatal #69
This file contains hidden or 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
| --- | |
| # This GitHub Actions workflow is designed to automate the process of updating | |
| # OVPN sources in the "sources" branch whenever there are changes pushed to the | |
| # "main" branch. Files under drivers/net/ovpn and include/uapi/linux/ovpn.h are | |
| # forced to be added to the commit so that they can be included in the generated | |
| # tarball. | |
| name: Update Sources | |
| "on": | |
| push: | |
| paths-ignore: | |
| - ".github/workflows/**" | |
| - "ci/**" | |
| - "README.md" | |
| workflow_dispatch: | |
| jobs: | |
| update-sources: | |
| if: > | |
| startsWith(github.ref, 'refs/heads/') && | |
| ( | |
| vars.UPDATE_SOURCES_ON_ANY_PUSH == '1' || | |
| github.ref_name == 'main' || | |
| github.ref_name == 'net' || | |
| github.ref_name == 'development' || | |
| github.ref_name == 'development-net' | |
| ) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure Git | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| - name: Generate Sources | |
| run: | | |
| chmod +x ./backports-ctl.sh | |
| ./backports-ctl.sh get-ovpn | |
| - name: Checkout Target Branch | |
| run: | | |
| # Determine the push branch (main or development) | |
| branch="${GITHUB_REF#refs/heads/}" | |
| # Determine the branch where the sources should be pushed | |
| # main -> sources | |
| # development -> development-sources | |
| # net -> net-sources | |
| # development-net -> development-net-sources | |
| if [ "$branch" = "main" ]; then | |
| target_branch="sources" | |
| else | |
| target_branch="${branch}-sources" | |
| fi | |
| git fetch origin "$target_branch" | |
| git reset "origin/$target_branch" | |
| - name: Commit and Push Changes | |
| run: | | |
| # Don't commit changes to this file since it may cause problems when | |
| # pushing | |
| git restore --staged .github/workflows/update-source.yml || true | |
| git restore .github/workflows/update-source.yml || true | |
| # Ensure the .version contains the correct backports commit hash | |
| hash=$(echo "$GITHUB_SHA" | cut -c1-7) | |
| sed -i "s/backports_commit=.*/backports_commit=$hash/" ./.version | |
| # Retrieve the version variables | |
| source ./.version | |
| git add -f drivers/net/ovpn include/uapi/linux/ovpn.h .version | |
| git add . | |
| # Add a 2 digit monithonically increasing counter to allow multiple | |
| # tags per day. To do this, we need to find the last tag for the | |
| # current branch and date, and increment it by 1 starting from 00. | |
| current_date=$(date +%Y%m%d) | |
| suffix="$(git tag --sort=-creatordate | | |
| grep -E "^${tree}/${branch}-${kernel_version}-" | | |
| head -n1 | | |
| sed 's/.*-//')" | |
| tag_date=$(echo "$suffix" | cut -c1-8) | |
| counter=$(echo "$suffix" | cut -c9-10) | |
| if [ "$tag_date" != "$current_date" ] || | |
| [ -z "$counter" ] || | |
| [ "${#counter}" != 2 ]; then | |
| counter="00" | |
| else | |
| counter=$(printf "%02d" $((10#$counter + 1))) | |
| fi | |
| VERSION="${tree}/${branch}-${kernel_version}-${current_date}${counter}" | |
| git commit -m "Generated sources for ${VERSION}" | |
| git tag -f "${VERSION}" | |
| # Determine the correct branch to push to | |
| if [ "$branch" = "main" ]; then | |
| target_branch="sources" | |
| else | |
| target_branch="${branch}-sources" | |
| fi | |
| git push origin HEAD:"$target_branch" | |
| git push origin --tags --force | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |