-
Notifications
You must be signed in to change notification settings - Fork 3
108 lines (93 loc) · 3.27 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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