2022-02-14 13:49:21 +03:00
|
|
|
name: SWC Bot
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2022-02-15 13:35:59 +03:00
|
|
|
|
|
|
|
env:
|
|
|
|
GIT_COMMITTER_NAME: "SWC Bot"
|
|
|
|
GIT_COMMITTER_EMAIL: "bot@swc.rs"
|
2022-02-14 13:49:21 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
auto-rebase:
|
|
|
|
name: Auto rebase
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
concurrency: swc-bot-auto-rebase
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
repository: "swc-project/swc"
|
|
|
|
ref: "main"
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: "16"
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
working-directory: scripts/bot
|
|
|
|
run: |
|
|
|
|
yarn
|
|
|
|
|
|
|
|
- name: Rebase a PR
|
|
|
|
working-directory: scripts/bot
|
|
|
|
run: |
|
|
|
|
npx ts-node src/auto-rebase.ts
|
|
|
|
env:
|
2022-02-14 20:18:29 +03:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
2022-02-15 13:35:59 +03:00
|
|
|
|
|
|
|
bump-crates:
|
|
|
|
name: Create cargo bump commit
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
concurrency: swc-bot-cargo-bump
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
repository: "swc-project/swc"
|
|
|
|
ref: "main"
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: "16"
|
|
|
|
|
|
|
|
- name: Install node dependencies
|
|
|
|
working-directory: scripts/bot
|
|
|
|
run: |
|
|
|
|
yarn
|
|
|
|
|
2022-02-16 08:12:22 +03:00
|
|
|
- name: Install cargo-mono
|
|
|
|
uses: baptiste0928/cargo-install@v1.1.0
|
|
|
|
with:
|
|
|
|
crate: cargo-mono
|
|
|
|
version: "0.3.1"
|
|
|
|
|
|
|
|
- name: Install git-cliff
|
|
|
|
uses: baptiste0928/cargo-install@v1.1.0
|
|
|
|
with:
|
|
|
|
crate: git-cliff
|
|
|
|
version: "0.6.0"
|
2022-02-15 13:35:59 +03:00
|
|
|
|
|
|
|
- name: Update changelog
|
|
|
|
run: |
|
|
|
|
yarn changelog
|
|
|
|
|
|
|
|
- name: Bump crates
|
|
|
|
working-directory: scripts/bot
|
|
|
|
run: |
|
|
|
|
npx ts-node src/cargo/bump.ts
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
|
|
|
|
|
|
- name: Update lockfile
|
|
|
|
run: |
|
|
|
|
cargo metadata --format-version 1 > /dev/null
|
|
|
|
|
|
|
|
- name: Create commit
|
|
|
|
run: |
|
|
|
|
git add -A
|
|
|
|
git commit --author="SWC Bot <bot@swc.rs>" -m 'chore: Publish crates'
|
|
|
|
|
2022-02-16 08:00:55 +03:00
|
|
|
- uses: webfactory/ssh-agent@v0.5.4
|
|
|
|
with:
|
|
|
|
ssh-private-key: ${{ secrets.SWC_BOT_SSH }}
|
|
|
|
|
2022-02-15 13:35:59 +03:00
|
|
|
- name: Push back
|
|
|
|
run: |
|
2022-02-16 08:00:55 +03:00
|
|
|
git push --no-verify
|
2022-02-15 13:35:59 +03:00
|
|
|
|
|
|
|
- name: Configure crates.io
|
|
|
|
run: |
|
|
|
|
cargo login $CARGO_TOKEN
|
|
|
|
env:
|
|
|
|
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
|
|
|
|
|
|
|
|
- name: Publish crates
|
|
|
|
run: |
|
|
|
|
cargo mono publish --no-verify
|