@@ -14,13 +14,13 @@ jobs:
1414 include :
1515 - os : ubuntu-latest
1616 target : x86_64-unknown-linux-gnu
17- suffix : " "
17+ suffix : " .gz "
1818 - os : macos-latest
1919 target : x86_64-apple-darwin
20- suffix : " "
20+ suffix : " .gz "
2121 - os : macos-latest
2222 target : aarch64-apple-darwin
23- suffix : " "
23+ suffix : " .gz "
2424 - os : windows-latest
2525 target : x86_64-pc-windows-msvc
2626 suffix : " .exe"
@@ -41,32 +41,43 @@ jobs:
4141 with :
4242 command : build
4343 args : --target ${{ matrix.target }} --release
44+
45+ - name : Compress and rename executable
46+ if : ${{ matrix.os != 'windows-latest' }}
47+ run : gzip -c target/${{ matrix.target }}/release/svd2rust > svd2rust-${{ matrix.target }}${{ matrix.suffix }}
4448 - name : Rename executable
45- run : mv target/${{ matrix.target }}/release/svd2rust${{ matrix.suffix }} target/${{ matrix.target }}/release/svd2rust-${{ matrix.target }}${{ matrix.suffix }}
49+ if : ${{ matrix.os == 'windows-latest' }}
50+ run : mv target/${{ matrix.target }}/release/svd2rust${{ matrix.suffix }} svd2rust-${{ matrix.target }}${{ matrix.suffix }}
51+
4652 - uses : actions/upload-artifact@v3
4753 with :
4854 name : svd2rust-${{ matrix.target }}
49- path : target/${{ matrix.target }}/release/ svd2rust-${{ matrix.target }}${{ matrix.suffix }}
55+ path : svd2rust-${{ matrix.target }}${{ matrix.suffix }}
5056
5157 release :
5258 name : release
5359 runs-on : ubuntu-latest
5460 needs : [build]
5561 steps :
62+ - uses : actions/checkout@v3
5663 - uses : actions/download-artifact@v3
5764 with :
5865 path : artifacts
5966 - run : ls -R ./artifacts
60- - uses : softprops/action-gh-release@v1
61- if : ${{ !startsWith(github.ref, 'refs/tags/v') }}
67+
68+ - name : Set current date as environment variable
69+ run : echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
70+
71+ - id : changelog-reader
72+ uses : mindsers/changelog-reader-action@v2.0.0
6273 with :
63- prerelease : true
64- name : " Pre-release"
65- tag_name : " pre-release"
66- files : |
67- artifacts/**/*
74+ version : ${{ (github.ref_type == 'tag' && github.ref_name) || 'Unreleased' }}
75+
6876 - uses : softprops/action-gh-release@v1
69- if : startsWith(github.ref, 'refs/tags/v')
7077 with :
78+ tag_name : ${{ steps.changelog-reader.outputs.version }}
79+ name : ${{ (github.ref_type == 'tag' && steps.changelog-reader.outputs.version) || format('Prereleased {0}', env.CURRENT_DATE) }}
80+ body : ${{ steps.changelog-reader.outputs.changes }}
81+ prerelease : ${{ steps.changelog-reader.outputs.status == 'unreleased' }}
7182 files : |
7283 artifacts/**/*
0 commit comments