An error occurred while loading the file. Please try again.
-
只敲代码不玩耍,聪明baka也变傻ᗜˬᗜ authored6457b633
name: Vendor Dependencies for GitLab
on:
push:
branches:
- '**'
workflow_dispatch:
jobs:
vendor:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Seems unnecessary
# with:
# fetch-depth: 0
- name: Set up Rust
env:
TOOLCHAIN_VERSION: nightly-2024-02-03
run: |
rustup toolchain install $TOOLCHAIN_VERSION --profile minimal
rustup default $TOOLCHAIN_VERSION
rustup override set $TOOLCHAIN_VERSION
rustup target add riscv64gc-unknown-none-elf
- name: Get current branch name
id: vars
run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b ${BRANCH_NAME}-vendored
- name: Vendor dependencies
run: |
cd kernel
cargo vendor ../third_party >> .cargo/config.toml
- name: Commit changes
run: |
git add .
git commit -m "Vendor dependencies"
# - name: Push vendored branch to repository
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# git push origin ${BRANCH_NAME}-vendored
- name: Push to GitLab
env:
GITLAB_URL: ${{ vars.GITLAB_URL }}
GITLAB_USER: ${{ vars.GITLAB_USER }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
run: |
# 添加GitLab远程仓库
git remote add gitlab $GITLAB_URL
# 使用token进行身份验证的URL
GITLAB_URL_WITH_AUTH=$(echo $GITLAB_URL | sed "s|https://|https://$GITLAB_USER:$GITLAB_TOKEN@|")
# 更新remote URL以包含认证信息
git remote set-url gitlab $GITLAB_URL_WITH_AUTH
# 推送所有分支和标签到GitLab
7172
git push --force gitlab ${BRANCH_NAME}-vendored