release #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| tags: | |
| - '*' | |
| workflow_dispatch: | |
| name: release | |
| env: | |
| RELEASE_BIN: malluscript | |
| RELEASE_ADDS: README.md LICENSE | |
| jobs: | |
| build: | |
| name: Build release | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| build: [linux, macos, windows] | |
| include: | |
| - build: linux | |
| os: ubuntu-latest | |
| rust: stable | |
| - build: macos | |
| os: macos-latest | |
| rust: stable | |
| - build: windows | |
| os: windows-latest | |
| rust: stable | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build | |
| run: cargo build --verbose --release | |
| - name: Create artifact directory | |
| run: mkdir artifacts | |
| - name: Create archive for Linux | |
| run: 7z a -ttar -so -an ./target/release/${{ env.RELEASE_BIN }} ${{ env.RELEASE_ADDS }} | 7z a -si ./artifacts/${{ env.RELEASE_BIN }}-linux-x86_64.tar.gz | |
| if: matrix.os == 'ubuntu-latest' | |
| - name: Create archive for Windows | |
| run: 7z a -tzip ./artifacts/${{ env.RELEASE_BIN }}-windows-x86_64.zip ./target/release/${{ env.RELEASE_BIN }}.exe ${{ env.RELEASE_ADDS }} | |
| if: matrix.os == 'windows-latest' | |
| - name: Install p7zip | |
| run: brew install p7zip | |
| if: matrix.os == 'macos-latest' | |
| - name: Create archive for MacOS | |
| run: 7z a -tzip ./artifacts/${{ env.RELEASE_BIN }}-mac-x86_64.zip ./target/release/${{ env.RELEASE_BIN }} ${{ env.RELEASE_ADDS }} | |
| if: matrix.os == 'macos-latest' | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.build }}-artifact | |
| path: artifacts/ |