File: release.yaml

package info (click to toggle)
rust-presenterm 0.15.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,692 kB
  • sloc: sh: 51; javascript: 36; makefile: 14
file content (114 lines) | stat: -rw-r--r-- 4,065 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Release

on:
  push:
    tags:
      - "v*.*.*"

jobs:
  changelog:
    name: Parse changelog
    runs-on: ubuntu-latest
    outputs:
      notes: ${{ steps.parse.outputs.notes }}
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v3

      - name: Parse release notes
        id: parse
        shell: bash
        run: |
          release_version=v${GITHUB_REF:11}
          r=$(./scripts/parse-changelog.sh "${release_version}")
          r="${r//'%'/'%25'}"
          r="${r//$'\n'/'%0A'}"
          r="${r//$'\r'/'%0D'}"
          echo "notes=$r" >> "$GITHUB_OUTPUT"
  

  publish-github:
    name: Publish on GitHub
    runs-on: ${{ matrix.config.OS }}
    needs: changelog
    strategy:
      fail-fast: false
      matrix:
        config:
          - { OS: ubuntu-latest, TARGET: "x86_64-unknown-linux-gnu" }
          - { OS: ubuntu-latest, TARGET: "x86_64-unknown-linux-musl" }
          - { OS: ubuntu-latest, TARGET: "i686-unknown-linux-gnu" }
          - { OS: ubuntu-latest, TARGET: "i686-unknown-linux-musl" }
          - { OS: ubuntu-latest, TARGET: "armv5te-unknown-linux-gnueabi" }
          - { OS: ubuntu-latest, TARGET: "armv7-unknown-linux-gnueabihf" }
          - { OS: ubuntu-latest, TARGET: "aarch64-unknown-linux-gnu" }
          - { OS: ubuntu-latest, TARGET: "aarch64-unknown-linux-musl" }
          - { OS: macos-latest, TARGET: "x86_64-apple-darwin" }
          - { OS: macos-latest, TARGET: "aarch64-apple-darwin" }
          - { OS: windows-latest, TARGET: "x86_64-pc-windows-msvc" }
          - { OS: windows-latest, TARGET: "i686-pc-windows-msvc" }

    steps:
      - name: Checkout the repository
        uses: actions/checkout@v4

      - name: Set the release version
        shell: bash
        run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV

      - name: Build binary
        uses: houseabsolute/actions-rust-cross@a448c4b13769d56b63b035024fef8577e1d81915
        with:
          command: build
          toolchain: 1.82.0
          target: ${{ matrix.config.TARGET }}
          args: "--locked --release"

      - name: Prepare release assets
        shell: bash
        run: |
          mkdir release/
          cp {LICENSE,README.md} release/
          cp target/${{ matrix.config.TARGET }}/release/presenterm release/
          mv release/ presenterm-${{ env.RELEASE_VERSION }}/

      - name: Create release artifacts
        shell: bash
        run: |
          if [ "${{ matrix.config.OS }}" = "windows-latest" ]; then
            7z a -tzip "presenterm-${{ env.RELEASE_VERSION }}-${{ matrix.config.TARGET }}.zip" \
              presenterm-${{ env.RELEASE_VERSION }}
            sha512sum "presenterm-${{ env.RELEASE_VERSION }}-${{ matrix.config.TARGET }}.zip" \
              > presenterm-${{ env.RELEASE_VERSION }}-${{ matrix.config.TARGET }}.zip.sha512
          else
            tar -czvf presenterm-${{ env.RELEASE_VERSION }}-${{ matrix.config.TARGET }}.tar.gz \
              presenterm-${{ env.RELEASE_VERSION }}/
            shasum -a 512 presenterm-${{ env.RELEASE_VERSION }}-${{ matrix.config.TARGET }}.tar.gz \
              > presenterm-${{ env.RELEASE_VERSION }}-${{ matrix.config.TARGET }}.tar.gz.sha512
          fi

      - name: Upload the release
        uses: svenstaro/upload-release-action@e2a63377780a8bacc68dcac9b0979ee20ad5a791
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: presenterm-${{ env.RELEASE_VERSION }}-${{ matrix.config.TARGET }}.*
          file_glob: true
          overwrite: true
          release_name: v${{ env.RELEASE_VERSION }}
          tag: ${{ github.ref }}
          body: |
            ${{ needs.changelog.outputs.notes }}

  publish-crates-io:
    name: Publish on crates.io
    needs: publish-github
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v4

      - name: Install rust toolchain
        uses: dtolnay/rust-toolchain@1.82.0

      - name: Publish
        run: cargo publish --locked --token ${{ secrets.CARGO_TOKEN }}