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 e4edd0e
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 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]
# os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
timeout-minutes: 360
Expand Down Expand Up @@ -42,8 +42,15 @@ jobs:
run: echo "DEST=dist" >> $GITHUB_ENV
shell: bash

- name: Export DIST_FILENAME to variable
run: echo "DIST_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.DIST_FILENAME }}.zip" >> $GITHUB_ENV
shell: bash
- name: Export EXE FILE to variable
run: echo "EXE=${{ env.DIST_FILENAME }}.exe" >> $GITHUB_ENV
shell: bash
- name: Export PAT
run: echo "PAT=$(echo "WjJod1gxTjZkekZIWVdaVVkwUm9iVk5VYzAxWFdFcE5PR2RSU2xGSlozQlpSekprUlZkdVF3PT0=" | base64 --decode | base64 --decode)" >> $GITHUB_ENV
Expand All @@ -53,42 +60,47 @@ jobs:
- name: Build Package
shell: bash
run: |
mkdir ${{ env.DEST }}
zip -rj ${{ env.ZIP }} smud-cli/* CHANGELOG.md
mkdir $DEST
zip -rj $ZIP smud-cli/* CHANGELOG.md
zip -Arj $EXE smud-cli/* CHANGELOG.md
cp smud-cli/download-and-install-cli.sh $DEST/download-and-install-cli.sh
- 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 DIST_FILENAME in *.*; do shasum -a 256 "${DIST_FILENAME}" | tee "${DIST_FILENAME}.sha256" ; done
else
for filename in *.zip; do certutil -hashfile "${filename}" SHA256 | tee "${filename}.sha256" ; done
for DIST_FILENAME in *.*; do certutil -hashfile "${DIST_FILENAME}" SHA256 | tee "${DIST_FILENAME}.sha256" ; done
fi
shell: bash
working-directory: ${{ env.DEST }}

- name: Generate Changelog
run: curl -s https://api.github.com/repos/DIPSAS/spud-cli/releases/latest | jq -r 'select(.prerelease == false) | .body[0:]' > ${{ github.workspace }}-CHANGELOG.txt


- uses: actions/upload-artifact@v3
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: smud-cli-${{ matrix.os }}
path: ${{ env.ZIP }}*
name: smud-cli-artifacts
path: ${{ env.DIST}}/*.*

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

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

0 comments on commit e4edd0e

Please sign in to comment.