-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
77 additions
and
1 deletion.
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,77 @@ | ||
name: Sync from Aptos Core | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
jobs: | ||
sync: | ||
runs-on: runs-on,runner=2cpu-linux-x64,run-id=${{ github.run_id }} | ||
steps: | ||
# Set up the git credentials for the job (using the aptos-bot personal access token) | ||
# - uses: oleksiyrudenko/[email protected] | ||
# with: | ||
# global: true | ||
# name: "aptos-bot" | ||
# token: ${{ secrets.APTOS_BOT_GH_PAT }} | ||
|
||
# Reconfigure the git url and credentials such that calling 'git clone <URL>' will work | ||
# - name: Set github url and credentials | ||
# run: | | ||
# /usr/bin/git config --global --add url."https://${{ secrets.APTOS_BOT_GH_PAT }}:x-oauth-basic@github".insteadOf ssh://git@github | ||
# /usr/bin/git config --global --add url."https://${{ secrets.APTOS_BOT_GH_PAT }}:x-oauth-basic@github".insteadOf https://github | ||
# /usr/bin/git config --global --add url."https://${{ secrets.APTOS_BOT_GH_PAT }}:x-oauth-basic@github".insteadOf git@github | ||
|
||
# Set up the git credentials for the job (using the aptos-bot personal access token) | ||
- uses: oleksiyrudenko/[email protected] | ||
with: | ||
global: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Reconfigure the git url and credentials such that calling 'git clone <URL>' will work | ||
- name: Set github url and credentials | ||
run: | | ||
/usr/bin/git config --global --add url."https://${{ secrets.GITHUB_TOKEN }}:x-oauth-basic@github".insteadOf ssh://git@github | ||
/usr/bin/git config --global --add url."https://${{ secrets.GITHUB_TOKEN }}:x-oauth-basic@github".insteadOf https://github | ||
/usr/bin/git config --global --add url."https://${{ secrets.GITHUB_TOKEN }}:x-oauth-basic@github".insteadOf git@github | ||
- name: Checkout copybara | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: google/copybara | ||
path: copybara | ||
|
||
- uses: bazel-contrib/[email protected] | ||
with: | ||
# Avoid downloading Bazel every time. | ||
bazelisk-cache: true | ||
# Store build cache per workflow. | ||
disk-cache: ${{ github.workflow }} | ||
# Share repository cache between workflows. | ||
repository-cache: true | ||
bazelisk-version: 1.x | ||
|
||
- name: Build copybara | ||
working-directory: copybara | ||
run: | | ||
set -x | ||
bazel build //java/com/google/copybara:copybara_deploy.jar | ||
cp bazel-bin/java/com/google/copybara/copybara_deploy.jar /usr/local/bin/ | ||
cat <<'EOF' > /usr/local/bin/copybara | ||
#!/bin/bash -e | ||
java -jar /usr/local/bin/copybara_deploy.jar "$@" | ||
EOF | ||
chmod +x /usr/local/bin/copybara | ||
- name: Run copybara | ||
run: | | ||
copybara | ||