-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into storage_messages
- Loading branch information
Showing
1,952 changed files
with
669,501 additions
and
248,138 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Build BAPI | ||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
build-bapi: | ||
if: | | ||
github.event.issue.pull_request && | ||
(github.event.comment.body == '!build_bapi') && | ||
((github.event.sender.id == github.event.issue.user.id) || | ||
(github.event.comment.author_association == 'COLLABORATOR') || | ||
(github.event.comment.author_association == 'MEMBER') || | ||
(github.event.comment.author_association == 'OWNER')) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Like the comment | ||
env: | ||
BASE_REPOSITORY: ${{ github.repository }} | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/$BASE_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \ | ||
-f content='+1' | ||
- name: PR Data | ||
run: | | ||
pr_json=$(curl -L -s --fail-with-body -H "Authorization: token ${{ github.token }}" ${{ github.event.issue.pull_request.url }}) | ||
if [ `jq -r '.maintainer_can_modify' <<<$pr_json` == "false" ] ; then | ||
gh pr comment ${{ github.event.issue.html_url }} --body 'GitHub Actions can not push to the repository without "Allow edits and access to secrets by maintainers" checked.' | ||
echo "FAIL_NOTIFIED=true" >> "$GITHUB_ENV" | ||
exit 1 | ||
fi | ||
echo "PR_REPO=`jq -r '.head.repo.full_name' <<<$pr_json`" >> $GITHUB_ENV | ||
echo "PR_BRANCH=`jq -r '.head.ref' <<<$pr_json`" >> $GITHUB_ENV | ||
echo "PR_HEAD_LABEL=`jq -r '.head.label' <<<$pr_json`" >> $GITHUB_ENV | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ env.PR_REPO }} | ||
ref: ${{ env.PR_BRANCH }} | ||
token: ${{ github.token }} | ||
|
||
- name: Build BAPI | ||
env: | ||
BASE_BRANCH: ${{ github.event.repository.default_branch }} | ||
BASE_REPOSITORY: ${{ github.repository }} | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
# Get the code. | ||
git config user.name AuroraBuildBot | ||
git config user.email "[email protected]" | ||
git pull origin "$PR_BRANCH" --depth=$((ahead_by + 1)) | ||
git remote add upstream "https://github.com/$BASE_REPOSITORY.git" | ||
git fetch upstream "$BASE_BRANCH" --depth=$((behind_by + 1)) | ||
cd rust/bapi | ||
# Get dependencies. | ||
rustup target add i686-unknown-linux-gnu | ||
rustup target add i686-pc-windows-gnu | ||
sudo dpkg --add-architecture i386 | ||
sudo apt-get update | ||
sudo apt-get install zlib1g-dev:i386 lib32gcc-11-dev mingw-w64 mingw-w64-i686-dev | ||
# Build it. | ||
cargo build --release --target i686-unknown-linux-gnu | ||
cargo build --release --target i686-pc-windows-gnu | ||
# Copy the built targets to their checked-in locations. | ||
cp target/i686-unknown-linux-gnu/release/libbapi.so ../../tools/ci/libbapi_ci.so | ||
cp target/i686-pc-windows-gnu/release/bapi.dll ../../bapi.dll | ||
# Check if a workflow file would be modified by the merge (permissions prevent pushes if so) | ||
latest_workflow_commit=$(git log -n 1 --pretty=format:"%H" upstream/$BASE_BRANCH -- .github/workflows) | ||
if ! git branch --contains $latest_workflow_commit | grep -q "$(git rev-parse --abbrev-ref HEAD)"; then | ||
gh pr comment ${{ github.event.issue.html_url }} --body "GitHub Actions can not push to this branch as workflow files have been changed since your branch was last updated. Please update your branch past https://github.com/$BASE_REPOSITORY/commit/$latest_workflow_commit before using this command again." | ||
echo "FAIL_NOTIFIED=true" >> "$GITHUB_ENV" | ||
exit 1 | ||
fi | ||
git commit -a -m "Build BAPI" --allow-empty | ||
git push origin | ||
- name: Notify Failure | ||
if: failure() && env.FAIL_NOTIFIED != 'true' | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh pr comment ${{ github.event.issue.html_url }} -b 'Building BAPI failed, see the action run log for details: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' |
This file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,53 @@ | ||
name: "Build Changelog" | ||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'html/changelogs/**' | ||
|
||
jobs: | ||
update-changelog: | ||
concurrency: changelog | ||
compile: | ||
name: "Compile changelogs" | ||
runs-on: ubuntu-22.04 | ||
if: "!contains(github.event.head_commit.message, '[ci skip]')" | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.BOT_TOKEN_AURORA }} | ||
|
||
- name: Update Changelogs | ||
run: | | ||
tools/bootstrap/python tools/GenerateChangelog/ss13_genchangelog.py html/changelog.html html/changelogs | ||
- name: Commit Changelogs | ||
run: | | ||
git pull origin master | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "AuroraBuildBot" | ||
git add --force html/* | ||
git commit -m "Automatic Changelog compile [ci skip]" -a || true | ||
- name: Push | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.BOT_TOKEN_AURORA }} | ||
- name: "Check for BOT_TOKEN_AURORA secret and pass true to output if it exists to be checked by later steps" | ||
id: value_holder | ||
env: | ||
ENABLER_SECRET: ${{ secrets.BOT_TOKEN_AURORA }} | ||
run: | | ||
unset SECRET_EXISTS | ||
if [ -n "$ENABLER_SECRET" ]; then SECRET_EXISTS=true ; fi | ||
echo "ACTIONS_ENABLED=$SECRET_EXISTS" >> $GITHUB_OUTPUT | ||
- name: "Setup python" | ||
if: steps.value_holder.outputs.ACTIONS_ENABLED | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.x' | ||
- name: "Install deps" | ||
if: steps.value_holder.outputs.ACTIONS_ENABLED | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pyyaml | ||
sudo apt-get install dos2unix | ||
- name: "Checkout" | ||
if: steps.value_holder.outputs.ACTIONS_ENABLED | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 25 | ||
persist-credentials: false | ||
- name: "Compile" | ||
if: steps.value_holder.outputs.ACTIONS_ENABLED | ||
run: | | ||
tools/bootstrap/python tools/GenerateChangelog/ss13_genchangelog.py html/changelogs | ||
- name: Commit | ||
if: steps.value_holder.outputs.ACTIONS_ENABLED | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Changelogs" | ||
git pull origin master | ||
git add html/changelogs | ||
git commit -m "Automatic changelog compile [ci skip]" -a || true | ||
- name: "Push" | ||
if: steps.value_holder.outputs.ACTIONS_ENABLED | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.BOT_TOKEN_AURORA || secrets.GITHUB_TOKEN }} |
This file contains 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 file contains 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 file contains 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
Oops, something went wrong.