|
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
5 |
| - branches: [ "*.*.*" ] |
| 5 | + branches: [ "*.*.x" ] |
6 | 6 | pull_request:
|
7 | 7 |
|
8 | 8 | env:
|
@@ -47,48 +47,19 @@ jobs:
|
47 | 47 | - run: cargo test
|
48 | 48 |
|
49 | 49 | build:
|
50 |
| - name: Build & upload an artifact |
| 50 | + name: Build & upload artifacts |
51 | 51 | runs-on: windows-latest
|
52 | 52 | env:
|
53 | 53 | ARCHIVE_NAME: redscript-${{ github.ref_name }}.zip
|
54 |
| - GIT_CLIFF_VERSION: 0.10.0 |
55 |
| - CHANGELOG_FILE: ${{ github.workspace }}-CHANGES.md |
56 | 54 |
|
57 | 55 | steps:
|
58 | 56 | - uses: actions/checkout@v3
|
59 |
| - with: |
60 |
| - fetch-depth: 0 |
61 | 57 | - uses: dtolnay/rust-toolchain@stable
|
62 | 58 | - uses: Swatinem/rust-cache@v2
|
63 | 59 |
|
64 | 60 | - name: Build and package the mod archive
|
65 | 61 | run: .\resources\package.ps1 -stagingDir ${{ runner.temp }}/redscript-staging -archiveName ${{ env.ARCHIVE_NAME }}
|
66 | 62 |
|
67 |
| - - name: Install git-cliff |
68 |
| - if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
69 |
| - uses: Alex079/setup-custom-tool@v1 |
70 |
| - with: |
71 |
| - archiveUrl: https://github.com/orhun/git-cliff/releases/download/v${{ env.GIT_CLIFF_VERSION }}/git-cliff-${{ env.GIT_CLIFF_VERSION }}-x86_64-pc-windows-msvc.zip |
72 |
| - archiveGlob: '*' |
73 |
| - toolName: git-cliff |
74 |
| - toolVersion: ${{ env.GIT_CLIFF_VERSION }} |
75 |
| - |
76 |
| - - name: Generate a changelog |
77 |
| - if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
78 |
| - run: git cliff --current --strip header -o ${{ env.CHANGELOG_FILE }} |
79 |
| - |
80 |
| - - name: Release |
81 |
| - uses: softprops/action-gh-release@v1 |
82 |
| - if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
83 |
| - with: |
84 |
| - body_path: ${{ env.CHANGELOG_FILE }} |
85 |
| - files: | |
86 |
| - ${{ env.MOD_ARTIFACT_PATH }} |
87 |
| - ./target/release/redscript-cli.exe |
88 |
| - prerelease: ${{ contains(github.ref_name, '-RC') || contains(github.ref_name, '-M') }} |
89 |
| - env: |
90 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
91 |
| - |
92 | 63 | - name: Archive artifacts
|
93 | 64 | uses: actions/upload-artifact@v3
|
94 | 65 | if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
|
0 commit comments