Skip to content

Commit

Permalink
ci(release): fix distribution artifacts (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Jun 21, 2024
1 parent 5b80421 commit 5c0d0e8
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
branches:
- master
workflow_dispatch:
env:
DIST: dist
jobs:
build:
name: Build distribution
Expand Down Expand Up @@ -105,14 +107,14 @@ jobs:
- name: Upload distribution archive
uses: actions/upload-artifact@v3
with:
name: ${{ steps.ostag.outputs.ostag }}
name: ${{ env.DIST }}
path: ./*.zip

- name: Upload distribution metadata
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: ${{ steps.ostag.outputs.ostag }}
name: ${{ env.DIST }}
path: |
./code.json
./code.md
Expand Down Expand Up @@ -159,17 +161,11 @@ jobs:
echo "$repo current version is $current"
echo "$repo next version is $next"
- name: Get OS tag
id: ostag
run: |
ostag=$(python -c "from modflow_devtools.ostags import get_ostag; print(get_ostag())")
echo "ostag=$ostag" >> $GITHUB_OUTPUT
- name: Download distribution
uses: actions/download-artifact@v3
with:
name: ${{ steps.ostag.outputs.ostag }}
path: ${{ steps.ostag.outputs.ostag }}
name: ${{ env.DIST }}
path: ${{ env.DIST }}

- name: List distribution files
run: ls -l ${{ steps.ostag.outputs.ostag }}
Expand All @@ -187,7 +183,7 @@ jobs:
- name: Build release body
run: |
cat Header.md ${{ steps.ostag.outputs.ostag }}/code.md > BodyFile.md
cat Header.md ${{ env.DIST }}/code.md > BodyFile.md
cat BodyFile.md
# interactive debugging
Expand All @@ -200,8 +196,8 @@ jobs:
id: update-readme
run: |
# update readme from metadata
cp ${{ steps.ostag.outputs.ostag }}/code.md code.md
cp ${{ steps.ostag.outputs.ostag }}/code.json code.json
cp ${{ env.DIST }}/code.md code.md
cp ${{ env.DIST }}/code.json code.json
python scripts/update_readme.py
# determine whether changes need to be committed
Expand Down Expand Up @@ -248,7 +244,7 @@ jobs:
tag: ${{ steps.next-tag.outputs.tag }}
name: "MODFLOW and related programs binary executables"
bodyFile: "./BodyFile.md"
artifacts: "${{ steps.ostag.outputs.ostag }}/*"
artifacts: "${{ env.DIST }}/*"
draft: false
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 5c0d0e8

Please sign in to comment.