Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
aho-dips committed Dec 1, 2023
1 parent 7e4d560 commit fc83313
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
release_smud_cli:
strategy:
matrix:
os: [ ubuntu-latest ]
os: [ ubuntu-latest, windows-latest ]
# os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
timeout-minutes: 360
Expand Down Expand Up @@ -42,26 +42,43 @@ jobs:
run: echo "DEST=dist" >> $GITHUB_ENV
shell: bash

- name: Export FILENAME to variable
run: echo "FILENAME=${{ env.DEST }}/smud-cli-${{ env.CLI_VERSION }}-${{ env.BUILD_ID }}" >> $GITHUB_ENV
shell: bash

- name: Export ZIP FILE to variable
run: echo "ZIP=${{ env.DEST }}/smud-cli-${{ env.CLI_VERSION }}-${{ env.BUILD_ID }}.${{ matrix.os }}.zip" >> $GITHUB_ENV
run: echo "ZIP=${{ env.FILENAME }}.zip" >> $GITHUB_ENV
shell: bash
- name: Export EXE FILE to variable
run: echo "EXE=${{ env.FILENAME }}.exe" >> $GITHUB_ENV
shell: bash
- name: Export PAT
run: echo "PAT=$(echo "WjJod1gxTjZkekZIWVdaVVkwUm9iVk5VYzAxWFdFcE5PR2RSU2xGSlozQlpSekprUlZkdVF3PT0=" | base64 --decode | base64 --decode)" >> $GITHUB_ENV
shell: bash


- name: Build Package
env:
FILE: ${{ env.ZIP }}
shell: bash
run: |
mkdir ${{ env.DEST }}
zip -rj ${{ env.ZIP }} smud-cli/* CHANGELOG.md
options="-rj"
PACK_FILE="${{ env.ZIP }}"
if [ "${{ matrix.os }}" = "windows-latest" ]; then
PACK_FILE="${{ env.EXE }}"
options="-Arj"
fi
zip $options $PACK_FILE smud-cli/* CHANGELOG.md
- name: Calculate SHA256 checksum
run: |-
if command -v shasum 2>/dev/null 1>&2; then
for filename in *.zip; do shasum -a 256 "${filename}" | tee "${filename}.sha256" ; done
for filename in *.*; do shasum -a 256 "${filename}" | tee "${filename}.sha256" ; done
else
for filename in *.zip; do certutil -hashfile "${filename}" SHA256 | tee "${filename}.sha256" ; done
for filename in *.*; do certutil -hashfile "${filename}" SHA256 | tee "${filename}.sha256" ; done
fi
shell: bash
Expand All @@ -74,21 +91,21 @@ jobs:
- uses: actions/upload-artifact@v3
with:
name: smud-cli-${{ matrix.os }}
path: ${{ env.ZIP }}*
path: ${{ env.DEST }}/*.*

- name: Release
uses: softprops/[email protected]
if: github.ref == 'refs/heads/main'
with:
tag_name: v${{ env.CLI_VERSION }}-${{ env.BUILD_ID }}
body_path: ${{ github.workspace }}-CHANGELOG.txt
files: ${{ env.ZIP }}*
path: ${{ env.DEST }}/*.*
token: ${{ env.PAT }}

- name: Latest
uses: softprops/[email protected]
if: github.ref == 'refs/heads/main'
with:
tag_name: Latest
files: ${{ env.ZIP }}*
path: ${{ env.DEST }}/*.*
token: ${{ env.PAT }}

0 comments on commit fc83313

Please sign in to comment.