Skip to content

Commit 327ae18

Browse files
committed
ci/test: resolve nesting issues
1 parent b939703 commit 327ae18

File tree

3 files changed

+31
-63
lines changed

3 files changed

+31
-63
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -85,27 +85,14 @@ jobs:
8585
sudo apt-get install zip
8686
fi
8787
zip --version
88-
# - name: "Package Docs Unix"
89-
# env:
90-
# TARGET_NAME: ${{ env.PROJECT_NAME }}-${{ matrix.target }}
91-
# PROJECT_NAME: ${{ env.PROJECT_NAME }}
92-
# shell: bash
93-
# run: |
94-
# cd "target/${{ matrix.target }}/doc/"
95-
# zip -r "$TARGET_NAME-docs.zip *"
96-
# zip -r "$TARGET_NAME-docs.zip" -@ << EOF
97-
# $(find "target/${{ matrix.target }}/doc/" -print0 | xargs -0 -I {} sh -c 'echo -n "{} "; echo $(basename {})'))
98-
# EOF
9988
- name: "Upload artifact"
10089
uses: actions/upload-artifact@v4
10190
with:
102-
name: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-docs
91+
name: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-docs.zip
10392
path: target/${{ matrix.target }}/doc/
104-
# "$TARGET_NAME-docs.zip"
10593
if-no-files-found: 'error'
10694
compression-level: '9'
10795
overwrite: 'true'
108-
# path: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-docs.zip
10996
package-docs-windows:
11097
name: "Docs - package-docs-windows"
11198
strategy:
@@ -135,27 +122,10 @@ jobs:
135122
RUSTDOCFLAGS: "-D warnings"
136123
run: cargo doc --no-deps --all-features --all --target ${{ matrix.target }} --document-private-items
137124
- name: "Upload artifact"
138-
# - name: "Package Docs Windows"
139-
# env:
140-
# TARGET_NAME: ${{ env.PROJECT_NAME }}-${{ matrix.target }}
141-
# TAG: ${{ github.ref_name }}
142-
# COPY_DOC_DIR_PATH: target\${{ matrix.target }}\doc
143-
# shell: powershell
144-
# run: |
145-
# Compress-Archive -Path "${env:COPY_DOC_DIR_PATH}\*" -DestinationPath "${env:TARGET_NAME}-docs" -CompressionLevel Optimal
146-
# New-Item -ItemType Directory -Path "${env:TARGET_NAME}-docs"
147-
# Copy-Item -Recurse -Path "${env:COPY_DOC_DIR_PATH}\*" -Destination "${env:TARGET_NAME}-docs"
148-
# Compress-Archive -Path "${env:TARGET_NAME}-docs\*" -DestinationPath "${env:TARGET_NAME}-docs"
149-
150-
# env:
151-
# TARGET_NAME: ${{ env.PROJECT_NAME }}-${{ matrix.target }}
152-
# TAG: ${{ github.ref_name }}
153-
# COPY_DOC_DIR_PATH: target\${{ matrix.target }}\doc
154125
uses: actions/upload-artifact@v4
155126
with:
156-
name: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-docs
127+
name: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-docs.zip
157128
path: target\${{ matrix.target }}\doc\
158-
# ${{ env.PROJECT_NAME }}-${{ matrix.target }}-docs.zip
159129
if-no-files-found: 'error'
160130
compression-level: '9'
161131
overwrite: 'true'

.github/workflows/draft.yml

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: "Draft"
2+
23
on:
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

1113
env:
@@ -14,6 +16,8 @@ env:
1416
CARGO_TERM_COLOR: always
1517
RUST_BACKTRACE: 1
1618
PROJECT_NAME: csv_parser_rs
19+
NIGHTLY_BODY: ${{ github.event.release.body }}
20+
1721
jobs:
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

.github/workflows/publish.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ jobs:
2828
file: ${{ env.PROJECT_NAME }}-*.zip
2929
file_glob: true
3030
overwrite: true
31-

0 commit comments

Comments
 (0)