@@ -2,11 +2,12 @@ name: Build and Upload Artifacts
22
33on :
44 workflow_run :
5- workflows : ["Rust Build & Test"]
6- types : [completed]
5+ workflows : [ "Rust Build & Test" ]
6+ types : [ completed ]
77
88jobs :
99 build :
10+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
1011 runs-on : ${{ matrix.os }}
1112 strategy :
1213 matrix :
@@ -28,14 +29,20 @@ jobs:
2829 - name : Checkout repository
2930 uses : actions/checkout@v4
3031
31- - name : Package binary and resources
32+ - name : Install Rust target
33+ run : rustup target add ${{ matrix.target }}
34+
35+ - name : Build binary
36+ run : cargo build --release --target ${{ matrix.target }}
37+
38+ - name : Package binary
3239 shell : bash
3340 run : |
3441 mkdir -p release_artifacts/${{ matrix.target }}
3542 cd target/${{ matrix.target }}/release
3643 mkdir -p rfortune-${{ matrix.target }}
3744 cp rfortune rfortune-${{ matrix.target }}/ 2>/dev/null || cp rfortune.exe rfortune-${{ matrix.target }}/
38- cp $GITHUB_WORKSPACE/README.md $GITHUB_WORKSPACE/ CHANGELOG.md $GITHUB_WORKSPACE/LICENSE rfortune-${{ matrix.target }}/
45+ cp $GITHUB_WORKSPACE/{ README.md,LICENSE, CHANGELOG.md} rfortune-${{ matrix.target }}/
3946
4047 if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
4148 powershell -Command "Compress-Archive -Path rfortune-${{ matrix.target }} -DestinationPath rfortune-${{ matrix.target }}.zip"
6572 run : |
6673 cd release_artifacts/${{ matrix.target }}
6774 file="rfortune-${{ matrix.target }}.${{ matrix.ext }}"
68-
6975 echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import
7076
7177 echo "$GPG_PASSPHRASE" | gpg --batch --yes --passphrase-fd 0 \
7783
7884 upload-artifacts :
7985 name : Upload All Artifacts
80- runs-on : ubuntu-latest
8186 needs : build
82- if : ${{ always() }}
87+ runs-on : ubuntu-latest
8388 steps :
8489 - name : Checkout repository
8590 uses : actions/checkout@v4
@@ -97,19 +102,13 @@ jobs:
97102 path : temp_download
98103 merge-multiple : true
99104
100- - name : DEBUG - verifica cosa è stato scaricato
101- shell : bash
102- run : |
103- echo "[DEBUG] Contenuto di temp_download:"
104- find temp_download || echo "temp_download è vuota o non trovata"
105-
106- - name : Move all platform builds into one folder
105+ - name : Consolidate all artifacts
107106 shell : bash
108107 run : |
109- mkdir release_artifacts
110- find temp_download -type f -name "rfortune-*" - exec cp {} release_artifacts/ \;
108+ mkdir -p release_artifacts
109+ find temp_download -type f -exec cp {} release_artifacts/ \;
111110
112- - name : Upload combined artifacts for release
111+ - name : Upload for Release
113112 uses : actions/upload-artifact@v4
114113 with :
115114 name : release_artifacts
0 commit comments