Skip to content

Commit

Permalink
Add permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Lacy committed Aug 28, 2024
1 parent da2130b commit e3dd7db
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
branches:
- '^v[0-9]+\.[0-9]+\.[0-9]+.*'
- 'fix/ci-github-actions-3'
permissions:
statuses: write
env:
CARGO_TERM_COLOR: always
WORKSPACE: "/home/runner/work/babylon-contract/babylon-contract"
Expand Down Expand Up @@ -37,7 +39,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 +57,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 +67,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 e3dd7db

Please sign in to comment.