-
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
28 additions
and
16 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] | ||
# os: [ ubuntu-latest, macos-latest, windows-latest ] | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 360 | ||
|
@@ -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 | ||
|
@@ -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 }} | ||
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 }}* | ||
name: Latest | ||
body_path: ${{ github.workspace }}-CHANGELOG.txt | ||
token: ${{ env.PAT }} | ||
files: ${{ env.DIST}}/*.* |