Skip to content

Commit fd0aa3a

Browse files
authored
fix composite action resolution by checking out repo first and building from sources (#72)
* fix composite action resolution by checking out repo first and building from sources * Refactor GitHub workflows to update checkout paths for 'sway' and 'fuel-core' repositories.
1 parent 047a15c commit fd0aa3a

File tree

2 files changed

+27
-18
lines changed

2 files changed

+27
-18
lines changed

.github/workflows/nightly-forc-release.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,14 @@ jobs:
8080
arch: arm64
8181
svm_target_platform: macosx-aarch64
8282
steps:
83-
- name: Checkout sources
83+
- name: Checkout this repo (action path)
84+
uses: actions/checkout@v3
85+
86+
- name: Checkout sway
8487
uses: actions/checkout@v3
8588
with:
8689
repository: fuellabs/sway
90+
path: sway
8791

8892
- name: Setup cross build environment
8993
uses: ./.github/actions/setup-cross-build
@@ -98,16 +102,13 @@ jobs:
98102
key: '${{ matrix.job.target }}'
99103

100104
- name: Install cargo-edit
101-
uses: actions-rs/cargo@v1
102-
with:
103-
command: install
104-
args: cargo-edit
105+
working-directory: sway
106+
run: cargo install cargo-edit
105107

106108
- name: Bump patch version and add nightly pre-release tag
107-
uses: actions-rs/cargo@v1
108-
with:
109-
command: set-version
110-
args: --metadata nightly.${{ inputs.date }}.${{ needs.prepare-release.outputs.commit_hash }}
109+
working-directory: sway
110+
run: |
111+
cargo set-version --metadata "nightly.${{ inputs.date }}.${{ needs.prepare-release.outputs.commit_hash }}"
111112
112113
- name: Use Cross
113114
uses: baptiste0928/cargo-install@v1
@@ -116,6 +117,7 @@ jobs:
116117
cache-key: '${{ matrix.job.target }}'
117118

118119
- name: Build forc binaries
120+
working-directory: sway
119121
run: |
120122
cross build --profile=release --locked --target ${{ matrix.job.target }} --bins
121123
@@ -125,6 +127,7 @@ jobs:
125127
PLATFORM_NAME: ${{ matrix.job.platform }}
126128
TARGET: ${{ matrix.job.target }}
127129
ARCH: ${{ matrix.job.arch }}
130+
working-directory: sway
128131
run: |
129132
ZIP_FILE_NAME=${{ needs.prepare-release.outputs.zip_name }}-${{ env.PLATFORM_NAME }}_${{ env.ARCH }}.tar.gz
130133
echo "ZIP_FILE_NAME=$ZIP_FILE_NAME" >> $GITHUB_ENV

.github/workflows/nightly-fuel-core-release.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,14 @@ jobs:
8080
platform: darwin-arm
8181
target: aarch64-apple-darwin
8282
steps:
83-
- name: Checkout repository
83+
- name: Checkout this repo (action path)
84+
uses: actions/checkout@v3
85+
86+
- name: Checkout fuel-core
8487
uses: actions/checkout@v3
8588
with:
8689
repository: fuellabs/fuel-core
90+
path: fuel-core
8791

8892
- name: Setup cross build environment
8993
uses: ./.github/actions/setup-cross-build
@@ -94,16 +98,13 @@ jobs:
9498
rust_version: ${{ env.RUST_VERSION }}
9599

96100
- name: Install cargo-edit
97-
uses: actions-rs/cargo@v1
98-
with:
99-
command: install
100-
args: cargo-edit
101+
working-directory: fuel-core
102+
run: cargo install cargo-edit
101103

102104
- name: Bump patch version and add nightly pre-release tag
103-
uses: actions-rs/cargo@v1
104-
with:
105-
command: set-version
106-
args: --metadata nightly.${{ inputs.date }}.${{ needs.prepare-release.outputs.commit_hash }}
105+
working-directory: fuel-core
106+
run: |
107+
cargo set-version --metadata "nightly.${{ inputs.date }}.${{ needs.prepare-release.outputs.commit_hash }}"
107108
108109
- uses: Swatinem/rust-cache@v1
109110
with:
@@ -117,15 +118,18 @@ jobs:
117118
cache-key: '${{ matrix.job.target }}'
118119

119120
- name: Build fuel-core
121+
working-directory: fuel-core
120122
run: |
121123
cross build --profile=release --target ${{ matrix.job.target }} --features "production" -p fuel-core-bin
122124
123125
- name: Strip release binary linux x86_64
124126
if: matrix.job.platform == 'linux'
127+
working-directory: fuel-core
125128
run: strip "target/${{ matrix.job.target }}/release/fuel-core"
126129

127130
- name: Strip release binary aarch64-linux-gnu
128131
if: matrix.job.target == 'aarch64-unknown-linux-gnu'
132+
working-directory: fuel-core
129133
run: |
130134
docker run --rm -v \
131135
"$PWD/target:/target:Z" \
@@ -135,12 +139,14 @@ jobs:
135139
136140
- name: Strip release binary mac
137141
if: matrix.job.os == 'macos-latest'
142+
working-directory: fuel-core
138143
run: strip -x "target/${{ matrix.job.target }}/release/fuel-core"
139144

140145
- name: Prepare Binary Artifact
141146
env:
142147
PLATFORM_NAME: ${{ matrix.job.platform }}
143148
TARGET: ${{ matrix.job.target }}
149+
working-directory: fuel-core
144150
run: |
145151
ARTIFACT="${{ needs.prepare-release.outputs.zip_name }}-${{ env.TARGET }}"
146152
ZIP_FILE_NAME="$ARTIFACT.tar.gz"

0 commit comments

Comments
 (0)