Skip to content

Commit a9bb85a

Browse files
Switch cache action
1 parent c1432fc commit a9bb85a

File tree

1 file changed

+31
-36
lines changed

1 file changed

+31
-36
lines changed

.github/workflows/release.yml

+31-36
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,9 @@ jobs:
4141
toolchain: stable
4242
target: ${{ matrix.target }}
4343
- uses: bahmutov/[email protected]
44-
- name: Cache Cargo
45-
uses: actions/cache@v4
44+
- uses: Swatinem/rust-cache@v2
4645
with:
47-
key: ${{ matrix.name }}-cargo-${{ hashFiles('**/Cargo.lock') }}
48-
path: |
49-
~/.cargo/bin/
50-
~/.cargo/git/db/
51-
~/.cargo/registry/cache/
52-
~/.cargo/registry/index/
53-
target/
54-
restore-keys: ${{ matrix.name }}-cargo-
46+
shared-key: ${{ matrix.name }}
5547
- name: Remove CommandLineTools SDKs
5648
if: ${{ matrix.target == 'aarch64-apple-darwin' }}
5749
run: sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
@@ -131,6 +123,9 @@ jobs:
131123
sudo apt-get update
132124
sudo apt-get install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
133125
- uses: bahmutov/[email protected]
126+
- uses: Swatinem/rust-cache@v2
127+
with:
128+
shared-key: ${{ matrix.target }}
134129
- name: Build native packages
135130
run: yarn build-native-release
136131
env:
@@ -202,29 +197,29 @@ jobs:
202197
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
203198
run: node -e 'require("@parcel/rust")'
204199

205-
# build-and-release:
206-
# runs-on: ubuntu-20.04
207-
# name: Build and release
208-
# needs:
209-
# - build-macos-windows
210-
# - build-linux-musl
211-
# - build-linux-gnu-arm
212-
# steps:
213-
# - uses: actions/checkout@v4
214-
# with:
215-
# fetch-depth: 0
216-
# - uses: bahmutov/[email protected]
217-
# - name: Build native packages
218-
# run: yarn build-native-release
219-
# - name: Download artifacts
220-
# uses: actions/download-artifact@v3
221-
# with:
222-
# path: artifacts
223-
# - name: Move artifacts
224-
# run: for d in artifacts/*/*/*; do cp $d/*.node packages/$(basename $(dirname $d))/$(basename $d); done
225-
# - name: Debug
226-
# run: ls -l packages/*/*/*.node
227-
# - run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
228-
# env:
229-
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
230-
# - run: ${{ inputs.release-command }}
200+
build-and-release:
201+
runs-on: ubuntu-20.04
202+
name: Build and release
203+
needs:
204+
- build-macos-windows
205+
- build-linux-musl
206+
- build-linux-gnu-arm
207+
steps:
208+
- uses: actions/checkout@v4
209+
with:
210+
fetch-depth: 0
211+
- uses: bahmutov/[email protected]
212+
- name: Build native packages
213+
run: yarn build-native-release
214+
- name: Download artifacts
215+
uses: actions/download-artifact@v3
216+
with:
217+
path: artifacts
218+
- name: Move artifacts
219+
run: for d in artifacts/*/*/*; do cp $d/*.node packages/$(basename $(dirname $d))/$(basename $d); done
220+
- name: Debug
221+
run: ls -l packages/*/*/*.node
222+
- run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
223+
env:
224+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
225+
- run: ${{ inputs.release-command }}

0 commit comments

Comments
 (0)