Skip to content

Commit

Permalink
Update build-release.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
soaressgabriel committed Mar 20, 2024
1 parent d12af7f commit 36f15bf
Showing 1 changed file with 60 additions and 53 deletions.
113 changes: 60 additions & 53 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,68 @@
name: Build Release
on:
push:
branches: "!*"
tags: "v*"
push:
branches: "!*"
tags: "v*"

jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: bash -el {0}

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

- name: Set up Python
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: rubem-ci
environment-file: env-ci.yml
python-version: 3.9
auto-activate-base: false

- name: Create Version File
run: |
Write-Output(("${{ github.ref_name }}" -replace 'v(.*)-.*', '$1') + '.0') > version.txt
create-version-file metadata.yml --outfile versionfile.txt
- name: Create Package
run: pyinstaller rubem.spec --noconfirm

- name: Test Package
run: |
./dist/rubem/rubem -h
- name: Zip files
run: |
Set-Location -Path .\dist\rubem
7z a -tzip -mx=9 -r "..\rubem-${{ github.ref_name }}-win-x86_64.zip" .\*
- name: Test Zip
run: |
7z t "dist/rubem-${{ github.ref_name }}-win-x86_64.zip"
- name: Compute Hash
run: |
$hash = Get-FileHash -Path dist/rubem-${{ github.ref_name }}-win-x86_64.zip -Algorithm SHA512
echo $hash.Hash $([System.IO.Path]::GetFileName($hash.Path)) > dist/rubem-${{ github.ref_name }}-win-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 }}-win-x86_64.zip
./dist/rubem-${{ github.ref_name }}-win-x86_64.zip.sha512
draft: false
prerelease: false
- name: Checkout repository
uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v1
with:
environment-file: env-ci.yml
init-shell: >-
bash
powershell
cache-environment: true
post-cleanup: "all"

- name: Create Version File
run: |
Write-Output(("${{ github.ref_name }}" -replace 'v(.*)-.*', '$1') + '.0') > version.txt
create-version-file metadata.yml --outfile versionfile.txt
shell: pwsh

- name: Create Package
run: pyinstaller rubem.spec --noconfirm

- name: Test Package
run: |
./dist/rubem/rubem -h
- name: Zip files
run: |
Set-Location -Path .\dist\rubem
7z a -tzip -mx=9 -r "..\rubem-${{ github.ref_name }}-win-x86_64.zip" .\*
shell: pwsh

- name: Test Zip
run: |
7z t "dist/rubem-${{ github.ref_name }}-win-x86_64.zip"
- name: Compute Hash
run: |
$hash = Get-FileHash -Path dist/rubem-${{ github.ref_name }}-win-x86_64.zip -Algorithm SHA512
echo $hash.Hash $([System.IO.Path]::GetFileName($hash.Path)) > dist/rubem-${{ github.ref_name }}-win-x86_64.zip.sha512
shell: pwsh

- 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 }}-win-x86_64.zip
./dist/rubem-${{ github.ref_name }}-win-x86_64.zip.sha512
draft: false
prerelease: false

0 comments on commit 36f15bf

Please sign in to comment.