mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-06-15 17:17:45 +08:00
* Updating Github Action - build all release images from binaries - create checksum of binary artifacts for release - adds clippy and crate advisory actions - update all dockerfiles to use ramdisk for building - separate actions to relevant files - adds arm64 binaries/docker image - update all debian builds to use bullseye (latest debian) * only run btc int tests on default branch * enable btc int test on develop * Feat/update ci (#38) * Updating Github Action - build all release images from binaries - create checksum of binary artifacts for release - adds clippy and crate advisory actions - update all dockerfiles to use ramdisk for building - separate actions to relevant files - adds arm64 binaries/docker image - update all debian builds to use bullseye (latest debian) * only run btc int tests on default branch * final action test disabled a lot of the long-running tests * Update ci.yml * Update ci.yml * Update bitcoin-tests.yml * Update bitcoin-tests.yml * run on push to master (merge) * Update Github Actions - build all release images from binaries - create checksum of binary artifacts for release - adds clippy and crate advisory actions - update all dockerfiles to use ramdisk for building - separate actions to relevant files - adds arm64 binaries/docker image - update all debian builds to use bullseye (latest debian) * adding build features to dockerfiles * update repo org to stacks-network missed a ref to wileyj forked repo * addressing comments in pr 3199 see https://github.com/stacks-network/stacks-blockchain/pull/3199 for changes requested * cleaning up docker tags prevent overwriting of docker image branch tags * disabling audit workflow disabling this workflow until we can test further * Adding a release file * Update to trigger logic Updating the logic of how/when builds and releases happen based on comments in PR. Updated the RELEASING.md file to reflect these changes * chore: delete circle.yml CircleCI hasn't been used in 11+ months. Fixes #3072 * switch repo&owner to var remove hardcoded value in favor or `GITHUB_REPOSITORY` * use local workflows * fix: don't assume that the bitcoin node always gives a non-zero number of headers * fix: add unit test and change log entry * fix: Exclude benchmarks from compilation * fix: Resolve conflicts and the remaining two errors * clean: remove benchmark files * fix: use explicit version number * minor update to reconcile diffs since some files were renamed, some minor changes had to be made manually here, i.e. fail_ci_if_error: false * hardcode some vals for testing * revert * use org/repo locations for jobs testing the locally built packages/docker images is successful, this reverts those changes need for testing the resulting artifacts * Moving file to docs dir * continue build if unit-tests fail use current settings from master branch * 3199 - minor updates for recent upstream changes --------- Co-authored-by: Diwaker Gupta <15990+diwakergupta@users.noreply.github.com> Co-authored-by: Jude Nelson <judecn@gmail.com> Co-authored-by: Stjepan Golemac <stjepan.golemac@gmail.com>
108 lines
3.8 KiB
YAML
108 lines
3.8 KiB
YAML
##
|
|
## Github workflow for auto-opening a PR on the stacks-network/docs repo
|
|
## whenever the auto-generated documentation here changes.
|
|
##
|
|
## It does this using a robot account `kantai-robot` to create a
|
|
## _base_ for the PR, the robot doesn't need any permissions to anyone
|
|
## else's git repositories.
|
|
##
|
|
|
|
name: Open Docs PR
|
|
|
|
env:
|
|
ROBOT_OWNER: kantai-robot
|
|
ROBOT_REPO: docs.blockstack
|
|
TARGET_OWNER: stacks-network
|
|
TARGET_REPO: docs
|
|
TARGET_REPOSITORY: stacks-network/docs
|
|
|
|
# Only run when:
|
|
# - push to master
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
dist:
|
|
name: Open Docs PR
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
ROBOT_BRANCH: ${{ format('auto/clarity-ref-{0}', github.sha) }}
|
|
steps:
|
|
- name: Checkout the latest code
|
|
id: git_checkout
|
|
uses: actions/checkout@v3
|
|
- name: Build docs
|
|
id: build_docs
|
|
env:
|
|
DOCKER_BUILDKIT: 1
|
|
run: rm -rf docs-output && docker build -o docs-output -f ./.github/actions/docsgen/Dockerfile.docsgen .
|
|
- name: Checkout latest docs
|
|
id: git_checkout_docs
|
|
uses: actions/checkout@v3
|
|
with:
|
|
token: ${{ secrets.DOCS_GITHUB_TOKEN }}
|
|
repository: ${{ env.TARGET_REPOSITORY }}
|
|
path: docs
|
|
- name: Branch and commit
|
|
id: push
|
|
run: |
|
|
cd docs
|
|
git config user.email "kantai+robot@gmail.com"
|
|
git config user.name "PR Robot"
|
|
git fetch --unshallow
|
|
git checkout -b $ROBOT_BRANCH
|
|
cp ../docs-output/clarity-reference.json ./src/_data/clarity-reference.json
|
|
cp ../docs-output/boot-contracts-reference.json ./src/_data/boot-contracts-reference.json
|
|
git add src/_data/clarity-reference.json
|
|
git add src/_data/boot-contracts-reference.json
|
|
if $(git diff --staged --quiet --exit-code); then
|
|
echo "No reference.json changes, stopping"
|
|
echo "::set-output name=open_pr::0"
|
|
else
|
|
git remote add robot https://github.com/$ROBOT_OWNER/$ROBOT_REPO
|
|
git commit -m "auto: update Clarity references JSONs from stacks-blockchain@${GITHUB_SHA}"
|
|
git push robot $ROBOT_BRANCH
|
|
echo "::set-output name=open_pr::1"
|
|
fi
|
|
- name: Open PR
|
|
id: open_pr
|
|
if: ${{ steps.push.outputs.open_pr == '1' }}
|
|
uses: actions/github-script@v6
|
|
with:
|
|
github-token: ${{ secrets.DOCS_GITHUB_TOKEN }}
|
|
script: |
|
|
// get env vars
|
|
const process = require("process");
|
|
const robot_owner = process.env.ROBOT_OWNER;
|
|
const robot_branch = process.env.ROBOT_BRANCH;
|
|
const head = `${robot_owner}:${robot_branch}`;
|
|
const owner = process.env.TARGET_OWNER;
|
|
const repo = process.env.TARGET_REPO;
|
|
|
|
console.log(`Checking PR with params: head= ${head} owner= ${owner} repo= ${repo}`);
|
|
|
|
// check if a pull exists
|
|
const existingPulls = await github.pulls.list({
|
|
owner, repo, state: "open" });
|
|
const myPulls = existingPulls.data.filter( pull => pull.user.login == robot_owner );
|
|
console.log(myPulls);
|
|
|
|
for (myPull of myPulls) {
|
|
// close any open PRs
|
|
const pull_number = myPull.number;
|
|
console.log(`Closing PR: ${ pull_number }`);
|
|
await github.pulls.update({ owner, repo, pull_number, state: "closed" });
|
|
}
|
|
|
|
// Open PR if one doesn't exist
|
|
console.log("Opening the new PR.");
|
|
let result = await github.pulls.create({
|
|
owner, repo, head,
|
|
base: "master",
|
|
title: "Auto: Update API documentation from stacks-blockchain",
|
|
body: "Update API documentation from the latest in `stacks-blockchain`",
|
|
});
|