File: release.yml

package info (click to toggle)
edu-sync 0.3.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 504 kB
  • sloc: makefile: 36; sh: 1
file content (44 lines) | stat: -rw-r--r-- 1,114 bytes parent folder | download | duplicates (2)
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
name: Release

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

env:
  GH_TOKEN: ${{ github.token }}

defaults:
  run:
    shell: bash

jobs:
  release:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04, macos-14, macos-13, windows-2019]
    steps:
    - uses: actions/checkout@v4
    - run: gh release create ${GITHUB_REF#refs/tags/} --draft --title ${GITHUB_REF#refs/tags/v}
      if: startsWith(matrix.os, 'ubuntu')
    - uses: dtolnay/rust-toolchain@stable
    - run: cargo build --release
    - name: Create archive
      run: |
        VERSION=${GITHUB_REF#refs/tags/}
        HOST=$(rustc -vV | sed -n 's|host: ||p')
        DIST=edu-sync-cli-$VERSION-$HOST

        mkdir $DIST

        if [ "${{ matrix.os }}" = windows-2019 ]; then
          mv target/release/edu-sync-cli.exe $DIST
          7z a $DIST.zip $DIST
          echo "FILE=$DIST.zip" >> $GITHUB_ENV
        else
          mv target/release/edu-sync-cli $DIST
          tar czf $DIST.tar.gz $DIST
          echo "FILE=$DIST.tar.gz" >> $GITHUB_ENV
        fi
    - run: gh release upload ${GITHUB_REF#refs/tags/} $FILE