Skip to content

chore(default-config): ignore wrap.serialized files #155

chore(default-config): ignore wrap.serialized files

chore(default-config): ignore wrap.serialized files #155

Workflow file for this run

name: CD-Rust
on:
# When Pull Request is merged
pull_request_target:
types: [closed]
jobs:
Core-Crates-Release:
runs-on: ubuntu-latest
if: |
github.event.pull_request.user.login == 'polywrap-build-bot' &&
github.event.pull_request.merged == true
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.base.ref }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.72.0
override: true
- name: Publish core crates to crates.io
run: .github/scripts/release.sh core
env:
CRATES_IO_TOKEN: ${{secrets.POLYWRAP_BUILD_BOT_CRATES_PAT}}
External-Crates-Release:
runs-on: ubuntu-latest
needs: Core-Crates-Release
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.base.ref }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.72.0
override: true
- name: Publish external crates to crates.io
run: .github/scripts/release.sh external
env:
CRATES_IO_TOKEN: ${{secrets.POLYWRAP_BUILD_BOT_CRATES_PAT}}
- name: Read VERSION into env.RELEASE_VERSION
run: echo RELEASE_VERSION=$(cat VERSION) >> $GITHUB_ENV
- uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '**[Crates.io Release Published](https://crates.io/search?q=polywrap) `${{env.RELEASE_VERSION}}`** 🎉'
})
Create-Gh-Tag-And-Release:
runs-on: ubuntu-latest
needs: External-Crates-Release
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.base.ref }}
- name: Set Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{github.repository}}
- name: Read VERSION into env.RELEASE_VERSION
run: echo RELEASE_VERSION=$(cat VERSION) >> $GITHUB_ENV
- name: Create Git Tag
uses: pkgdeps/git-tag-action@v2
with:
version: ${{ env.RELEASE_VERSION }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }}
git_commit_sha: ${{ github.sha }}
- name: Create Release
id: create_release
if: github.event.pull_request.merged == true
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
# Copy Pull Request's tile and body to Release Note
release_name: ${{ github.event.pull_request.title }}
body: |
${{ github.event.pull_request.body }}
draft: false
prerelease: false