11name : " Draft"
2+
23on :
34 push :
4- # branches:
5- # - master
6- # - main
7- tags : ["v[0-9]+.[0-9]+.[0-9]?"]
8- # workflow_dispatch:
5+ branches :
6+ - master
7+ - main
8+ tags : [ "v[0-9]+.[0-9]+.[0-9]?" ]
9+
10+ workflow_dispatch :
911# inputs:
1012
1113env :
1416 CARGO_TERM_COLOR : always
1517 RUST_BACKTRACE : 1
1618 PROJECT_NAME : csv_parser_rs
19+ NIGHTLY_BODY : ${{ github.event.release.body }}
20+
1721jobs :
1822 build-unix :
1923 name : " Draft - build-unix"
@@ -49,17 +53,14 @@ jobs:
4953 mkdir -p "${ARTIFACT_NAME}"
5054 cp "target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}" "${ARTIFACT_NAME}"
5155 cp "README.md" "LICENSE-MIT" "LICENSE-APACHE" "${ARTIFACT_NAME}"
52- # run: ./build/build.sh ${{ matrix.target }}
5356 - name : " Upload artifact"
5457 uses : actions/upload-artifact@v4
5558 with :
56- name : ${{ env.PROJECT_NAME }}-${{ matrix.target }}
57- path : ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}
58- # ${{ matrix.target }}
59- # path: ${{ env.PROJECT_NAME }}-${{ matrix.target }}.zip
59+ name : ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}.zip
60+ path : ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}.zip
6061 if-no-files-found : ' error'
6162 compression-level : ' 9'
62- overwrite : ' true'
63+ # overwrite: 'true'
6364 build-windows :
6465 name : " Draft - build-windows"
6566 strategy :
@@ -88,47 +89,44 @@ jobs:
8889 run : cargo build --release --locked --target ${{ matrix.target }}
8990 - name : " Pack artifact"
9091 shell : powershell
91- # env:
92- # TARGET_NAME: ${{ env.PROJECT_NAME }}-${{ matrix.target }}
93- # BINARY_DIR_PATH: target\${{ matrix.target }}\release
94- # TAG: ${{ github.ref_name }}
9592 run : |
9693 $ARTIFACT_NAME="${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}"
9794 New-Item -ItemType Directory -Path "$ARTIFACT_NAME"
9895 Copy-Item -Path "target\${{ matrix.target }}\release\${{ env.PROJECT_NAME }}.exe" -Destination "$ARTIFACT_NAME"
9996 Copy-Item -Path "README.md", "LICENSE-APACHE", "LICENSE-MIT" -Destination "$ARTIFACT_NAME"
100- # New-Item -ItemType Directory -Path "${env:TARGET_NAME}-${env:TAG}"
101- # Copy-Item -Path "${env:BINARY_DIR_PATH}\${{ env.PROJECT_NAME }}.exe" -Destination "${env:TARGET_NAME}-${env:TAG}\\"
102- # Copy-Item -Path "README.md", "LICENSE-APACHE", "LICENSE-MIT" -Destination "${env:TARGET_NAME}-${env:TAG}\\"
103- # Compress-Archive -Path "${env:TARGET_NAME}-${env:TAG}\*" -DestinationPath "${env:TARGET_NAME}-${env:TAG}.zip"
10497 - name : " Upload artifact"
10598 uses : actions/upload-artifact@v4
10699 with :
107- name : ${{ env.PROJECT_NAME }}-${{ matrix.target }}
108- path : ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}
109- # ${{ matrix.target }}
110- # name: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}
111- # path: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}.zip
100+ name : ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}.zip
101+ path : ${{ env.PROJECT_NAME }}-${{ matrix.target }}-${{ github.ref_name }}.zip
112102 if-no-files-found : ' error'
113103 compression-level : ' 9'
114- overwrite : ' true'
104+ # overwrite: 'true'
115105 draft :
116- if : startsWith(github.ref, 'refs/tags/')
106+ # TODO: swap these back when working
107+ # if: startsWith(github.ref, 'refs/tags/')
108+ if : always()
117109 permissions :
118110 contents : write
119111 runs-on : ubuntu-latest
120- needs : [build-unix, build-windows]
112+ needs : [ build-unix, build-windows ]
121113 steps :
122114 - uses : actions/download-artifact@v4
115+ id : artifact-download-step
123116 with :
124117 merge-multiple : true
125118 - name : " Draft"
126119 uses : softprops/action-gh-release@master
127120 with :
121+ repository : ${{ github.repository }}
122+ # TODO: and when done - remove this
123+ prerelease : true
124+
125+ fail_on_unmatched_files : true
128126 draft : true
129127 # make_latest: true ## Drafts & prereleases cannot be set as `make_latest:`
130128 files : |
131- ${{ env.PROJECT_NAME }}-*.zip
129+ ${{ steps.artifact-download-step.outputs.download-path }}
132130 generate_release_notes : true
133131 # body_path: ${{ github.workspace }}-CHANGELOG.txt ## For adding changelog content
134132
@@ -137,7 +135,7 @@ jobs:
137135 permissions :
138136 contents : write
139137 runs-on : ubuntu-latest
140- needs : [build-unix, build-windows]
138+ needs : [ build-unix, build-windows ]
141139 steps :
142140 - run : |
143141 echo 'NIGHTLY_BODY<<EOF' >> $GITHUB_ENV
@@ -154,10 +152,11 @@ jobs:
154152 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
155153 git tag --force nightly && git push --force origin tag nightly
156154 - name : " Nightly"
157- uses : softprops/action-gh-release@v1
155+ uses : softprops/action-gh-release@v2
158156 with :
159157 tag_name : nightly
160158 prerelease : true
159+ fail_on_unmatched_files : true
161160 files : |
162161 ${{ env.PROJECT_NAME }}-*.zip
163162 name : Nightly Build
0 commit comments