2
0
mirror of https://github.com/boostorg/nowide.git synced 2026-01-26 18:52:20 +00:00
Files
nowide/.github/workflows/update_standalone.yml
Alexander Grund a0327e0b74 Update license headers
Use the more concise format omitting the reference to the license file
and refer to the URL only.
2022-07-13 12:35:54 +02:00

46 lines
1.5 KiB
YAML

# Copyright 2019 - 2021 Alexander Grund
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
on:
push:
branches: [develop]
name: Update standalone branch
env:
STANDALONE_BRANCH_NAME: standalone
jobs:
update:
name: Update standalone branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup git
run: |
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --global user.name "$GITHUB_ACTOR"
git fetch
- name: Create standalone version
id: standalone
run: |
bash tools/create_standalone.sh /tmp/nowide_standalone
git checkout "$STANDALONE_BRANCH_NAME" -- || git checkout -b "$STANDALONE_BRANCH_NAME"
rm -r *
mv /tmp/nowide_standalone/* .
# Check if anything changed to avoid later failure.
# E.g. nothing changes if only CI files are modified which are removed by the above
if git diff --exit-code; then
echo "::set-output name=changed::false"
else
echo "::set-output name=changed::true"
fi
- name: Commit and push
if: steps.standalone.outputs.changed == 'true'
run: |
git add .
git commit -m "Include '${{github.event.head_commit.message}}'"
remote_repo="https://${GITHUB_ACTOR}:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git"
git push "$remote_repo" HEAD:$STANDALONE_BRANCH_NAME