Skip to content

Commit

Permalink
chore: use env pass
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Dec 4, 2024
1 parent 3ff6ddf commit 5332467
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 54 deletions.
8 changes: 4 additions & 4 deletions .github/actions/download-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ runs:
restore-keys: |
rust-artifact-${{ github.repository_id }}-${{ github.sha }}-${{ inputs.name }}
env:
ACCESS_KEY: ${{ inputs.tos-access-key }}
SECRET_KEY: ${{ inputs.tos-secret-key }}
BUCKET_NAME: ${{ inputs.tos-bucket-name }}
REGION: ${{ inputs.tos-region }}
ACCESS_KEY: ${{ env.TOS_ACCESS_KEY }}
SECRET_KEY: ${{ env.TOS_SECRET_KEY }}
BUCKET_NAME: ${{ env.TOS_BUCKET_NAME }}
REGION: ${{ env.TOS_REGION }}
20 changes: 4 additions & 16 deletions .github/actions/pnpm-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ inputs:
default: false
required: false
type: boolean
tos-access-key:
required: false
type: string
tos-secret-key:
required: false
type: string
tos-bucket-name:
required: false
type: string
tos-region:
required: false
type: string

runs:
using: composite
Expand Down Expand Up @@ -85,10 +73,10 @@ runs:
restore-keys: |
node-cache-${{ runner.os }}-pnpm-
env:
ACCESS_KEY: ${{ inputs.tos-access-key }}
SECRET_KEY: ${{ inputs.tos-secret-key }}
BUCKET_NAME: ${{ inputs.tos-bucket-name }}
REGION: ${{ inputs.tos-region }}
ACCESS_KEY: ${{ env.TOS_ACCESS_KEY }}
SECRET_KEY: ${{ env.TOS_SECRET_KEY }}
BUCKET_NAME: ${{ env.TOS_BUCKET_NAME }}
REGION: ${{ env.TOS_REGION }}

- name: Install dependencies
shell: bash
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/upload-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ runs:
restore-keys: |
rust-artifact-${{ github.repository_id }}-${{ github.sha }}-${{ inputs.name }}
env:
ACCESS_KEY: ${{ inputs.tos-access-key }}
SECRET_KEY: ${{ inputs.tos-secret-key }}
BUCKET_NAME: ${{ inputs.tos-bucket-name }}
REGION: ${{ inputs.tos-region }}
ACCESS_KEY: ${{ env.TOS_ACCESS_KEY }}
SECRET_KEY: ${{ env.TOS_SECRET_KEY }}
BUCKET_NAME: ${{ env.TOS_BUCKET_NAME }}
REGION: ${{ env.TOS_REGION }}

- name: Upload local
id: upload-local
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

env:
TOS_ACCESS_KEY: ${{ secrets.TOS_ACCESS_KEY }}
TOS_SECRET_KEY: ${{ secrets.TOS_SECRET_KEY }}
TOS_BUCKET_NAME: ${{ vars.TOS_BUCKET_NAME }}
TOS_REGION: ${{ vars.TOS_REGION }}

jobs:
get-runner-labels:
name: Get Runner Labels
Expand Down Expand Up @@ -284,10 +290,6 @@ jobs:
uses: ./.github/actions/pnpm-cache
with:
type: ${{ needs.get-runner-labels.outputs.LINUX_CACHE_TYPE }}
tos-access-key: ${{ secrets.TOS_ACCESS_KEY }}
tos-secret-key: ${{ secrets.TOS_SECRET_KEY }}
tos-bucket-name: ${{ vars.TOS_BUCKET_NAME }}
tos-region: ${{ vars.TOS_REGION }}

- name: Run Cargo Check
run: cargo check --workspace --all-targets --locked # Not using --release because it uses too much cache, and is also slow.
Expand Down Expand Up @@ -333,10 +335,6 @@ jobs:
uses: ./.github/actions/pnpm-cache
with:
type: ${{ needs.get-runner-labels.outputs.LINUX_CACHE_TYPE }}
tos-access-key: ${{ secrets.TOS_ACCESS_KEY }}
tos-secret-key: ${{ secrets.TOS_SECRET_KEY }}
tos-bucket-name: ${{ vars.TOS_BUCKET_NAME }}
tos-region: ${{ vars.TOS_REGION }}

- name: Install Rust Toolchain
uses: ./.github/actions/rustup
Expand Down Expand Up @@ -367,10 +365,6 @@ jobs:
uses: ./.github/actions/pnpm-cache
with:
type: ${{ needs.get-runner-labels.outputs.LINUX_CACHE_TYPE }}
tos-access-key: ${{ secrets.TOS_ACCESS_KEY }}
tos-secret-key: ${{ secrets.TOS_SECRET_KEY }}
tos-bucket-name: ${{ vars.TOS_BUCKET_NAME }}
tos-region: ${{ vars.TOS_REGION }}

- name: Install Rust Toolchain
uses: ./.github/actions/rustup
Expand Down
24 changes: 6 additions & 18 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ on:
# - github
# - local
# - lynx
tos-access-key:
required: false
type: string
tos-secret-key:
required: false
type: string
secrets:
TOS_ACCESS_KEY:
required: false
TOS_SECRET_KEY:
required: false

env:
TOS_ACCESS_KEY: ${{ secrets.TOS_ACCESS_KEY }}
TOS_SECRET_KEY: ${{ secrets.TOS_SECRET_KEY }}
TOS_BUCKET_NAME: ${{ vars.TOS_BUCKET_NAME }}
TOS_REGION: ${{ vars.TOS_REGION }}

jobs:
build:
name: Build
Expand Down Expand Up @@ -109,10 +109,6 @@ jobs:
with:
type: ${{ inputs.cache-type }}
save-if: ${{ github.ref_name == 'main' }}
tos-access-key: ${{ secrets.TOS_ACCESS_KEY }}
tos-secret-key: ${{ secrets.TOS_SECRET_KEY }}
tos-bucket-name: ${{ vars.TOS_BUCKET_NAME }}
tos-region: ${{ vars.TOS_REGION }}

- name: Install Rust Toolchain
if: ${{ !inputs.skipable }}
Expand Down Expand Up @@ -270,10 +266,6 @@ jobs:
with:
type: ${{ inputs.cache-type }}
node-version: 20
tos-access-key: ${{ secrets.TOS_ACCESS_KEY }}
tos-secret-key: ${{ secrets.TOS_SECRET_KEY }}
tos-bucket-name: ${{ vars.TOS_BUCKET_NAME }}
tos-region: ${{ vars.TOS_REGION }}

- name: Run e2e
uses: ./.github/actions/docker-run
Expand Down Expand Up @@ -333,10 +325,6 @@ jobs:
with:
type: ${{ inputs.cache-type }}
node-version: ${{ matrix.node }}
tos-access-key: ${{ secrets.TOS_ACCESS_KEY }}
tos-secret-key: ${{ secrets.TOS_SECRET_KEY }}
tos-bucket-name: ${{ vars.TOS_BUCKET_NAME }}
tos-region: ${{ vars.TOS_REGION }}

### x86_64-unknown-linux-gnu

Expand Down

0 comments on commit 5332467

Please sign in to comment.