Skip to content

Commit

Permalink
Add permissions for create-release job
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Lacy committed Aug 28, 2024
1 parent da2130b commit 4c11dc9
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ env:
jobs:
build_and_upload_contracts:
runs-on: ubuntu-latest
permissions:
pull-requests: read
statuses: write
steps:
- uses: actions/[email protected]
- name: Make temporary bin
run: mkdir -p /tmp/bin
- name: Install ghr
run: wget https://github.com/tcnksm/ghr/releases/download/v0.14.0/ghr_v0.14.0_linux_amd64.tar.gz -O - | tar -zxvf - -C /tmp/bin --wildcards --strip-components 1 */ghr
- name: Build optimised Wasm binaries
run: "./scripts/build-optimizer-ci.sh"
- uses: actions/[email protected]
Expand All @@ -37,7 +36,7 @@ jobs:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Attached there are some build artifacts generated at this tag. Those are for development purposes only! Please use crates.io to find the packages of this release.
Attached there are some build artifacts generated at this tag.
draft: false
prerelease: false
- name: Upload babylon_contract
Expand All @@ -55,8 +54,6 @@ jobs:
- uses: actions/[email protected]
- name: Make temporary bin
run: mkdir -p /tmp/bin
- name: Install ghr
run: wget https://github.com/tcnksm/ghr/releases/download/v0.14.0/ghr_v0.14.0_linux_amd64.tar.gz -O - | tar -zxvf - -C /tmp/bin --wildcards --strip-components 1 */ghr
- name: Build and run schema generator
run: |-
(cd ./contracts/babylon && cargo run --bin schema)
Expand All @@ -67,15 +64,12 @@ jobs:
cp -a ./contracts/*/schema/* ./schemas
- name: Show data
run: ls -l ./schemas
- name: Publish schemas on GitHub
run: |-
GITHUB_TOKEN="${{ github.token }}"
TAG="${{ github.ref }}"
TITLE="$TAG"
BODY="Attached there are some schemas and build artifacts generated at this tag. Those are for development purposes only! Please use crates.io to find the packages of this release."
/tmp/bin/ghr -t "$GITHUB_TOKEN" \
-u "$CIRCLE_PROJECT_USERNAME" -r "${{ github.repository }}" \
-c "${{ github.sha }}" \
-n "$TITLE" -b "$BODY" \
-replace \
"$TAG" ./schemas/
- name: Upload schemas
id: upload-schemas
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./schemas
asset_name: schemas

0 comments on commit 4c11dc9

Please sign in to comment.