@@ -14,13 +14,13 @@ jobs:
14
14
include :
15
15
- os : ubuntu-latest
16
16
target : x86_64-unknown-linux-gnu
17
- suffix : " "
17
+ suffix : " .gz "
18
18
- os : macos-latest
19
19
target : x86_64-apple-darwin
20
- suffix : " "
20
+ suffix : " .gz "
21
21
- os : macos-latest
22
22
target : aarch64-apple-darwin
23
- suffix : " "
23
+ suffix : " .gz "
24
24
- os : windows-latest
25
25
target : x86_64-pc-windows-msvc
26
26
suffix : " .exe"
@@ -41,32 +41,43 @@ jobs:
41
41
with :
42
42
command : build
43
43
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 }}
44
48
- 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
+
46
52
- uses : actions/upload-artifact@v3
47
53
with :
48
54
name : svd2rust-${{ matrix.target }}
49
- path : target/${{ matrix.target }}/release/ svd2rust-${{ matrix.target }}${{ matrix.suffix }}
55
+ path : svd2rust-${{ matrix.target }}${{ matrix.suffix }}
50
56
51
57
release :
52
58
name : release
53
59
runs-on : ubuntu-latest
54
60
needs : [build]
55
61
steps :
62
+ - uses : actions/checkout@v3
56
63
- uses : actions/download-artifact@v3
57
64
with :
58
65
path : artifacts
59
66
- 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
62
73
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
+
68
76
- uses : softprops/action-gh-release@v1
69
- if : startsWith(github.ref, 'refs/tags/v')
70
77
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' }}
71
82
files : |
72
83
artifacts/**/*
0 commit comments