Skip to content

Commit

Permalink
Adjustments to release GHA workflows (#10155)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-near authored Nov 10, 2023
1 parent 777fe0f commit ff9d8bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/near_crates_publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: near crates publish
name: Near crates publish

on:
push:
Expand All @@ -15,6 +15,12 @@ jobs:
timeout-minutes: 30

steps:
- name: Checkout near/nearcore branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up git user
uses: fregante/setup-git-user@v2
- name: Publish near-workspaces on crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Expand All @@ -26,6 +32,8 @@ jobs:
--tag-msg $$'crates.io snapshot\n---%{\n- %n - https://crates.io/crates/%n/%v}'
- name: Create tag on https://github.com/near/nearcore
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push --no-follow-tags https://github.com/near/nearcore.git tag 'crates-*'
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/nearcore_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
jobs:
binary-release:
name: "Build and publish neard binary"
runs-on: "ubuntu-22.04-8core"
runs-on: "ubuntu-22.04-16core"
environment: deploy
permissions:
id-token: write # required to use OIDC authentication
Expand Down Expand Up @@ -48,11 +48,10 @@ jobs:
- name: Neard binary build and upload to S3
run: |
chmod +x nearcore/scripts/binary-release.sh
nearcore/scripts/binary-release.sh
./scripts/binary_release.sh
- name: Update latest version metadata in S3
run: |
echo $(git rev-parse HEAD) > latest
branch=$(git rev-parse --abbrev-ref HEAD)
# aws s3 cp --acl public-read latest s3://build.nearprotocol.com/nearcore/$(uname)/${branch}/latest
aws s3 cp --acl public-read latest s3://build.nearprotocol.com/nearcore/$(uname)/${branch}/latest
7 changes: 2 additions & 5 deletions scripts/binary_release.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ case "$release" in
;;
esac

branch=${BUILDKITE_BRANCH:-${GITHUB_REF##*/}}
commit=${BUILDKITE_COMMIT:-${GITHUB_SHA}}
if [[ ${commit} = "HEAD" ]]; then
commit=$(git rev-parse HEAD)
fi
branch=$(git rev-parse --abbrev-ref HEAD)
commit=$(git rev-parse HEAD)

os=$(uname)
arch=$(uname -m)
Expand Down

0 comments on commit ff9d8bf

Please sign in to comment.