-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (56 loc) · 1.93 KB
/
build-release.yml
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
name: Build Release
on:
push:
branches: "!*"
tags: "v*"
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: env-ci.yml
init-shell: bash
cache-environment: true
post-cleanup: "all"
- name: Create Version File
run: |
echo "${{ github.ref_name }}" | sed -E 's/v(.*)-.*/\1/; s/$/.0/' > version.txt
create-version-file metadata.yml --outfile versionfile.txt
- name: Create Package (${{ matrix.os }})
run: pyinstaller rubem.spec --noconfirm
- name: Test Package
run: |
./dist/rubem/rubem -h
- name: Zip files
run: |
cd ./dist/rubem
7z a -tzip -mx=9 -r "..\rubem-${{ github.ref_name }}-${{ matrix.os }}-x86_64.zip" .\*
- name: Test Zip
run: |
7z t "dist/rubem-${{ github.ref_name }}-${{ matrix.os }}-x86_64.zip"
- name: Compute Hash
run: |
hash=$(sha512sum dist/rubem-${{ github.ref_name }}-${{ matrix.os }}-x86_64.zip | awk '{print $1}')
echo "$hash rubem-${{ github.ref_name }}-${{ matrix.os }}-x86_64.zip" > dist/rubem-${{ github.ref_name }}-${{ matrix.os }}-x86_64.zip.sha512
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
files: |
./dist/rubem-${{ github.ref_name }}-${{ matrix.os }}-x86_64.zip
./dist/rubem-${{ github.ref_name }}-${{ matrix.os }}-x86_64.zip.sha512
draft: false
prerelease: false