-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 }} |