fix: release ci (#34)

* fix: release ci

* change application name

* fix names
This commit is contained in:
Noah Citron 2022-09-14 20:36:04 -04:00 committed by GitHub
parent 3e21c282e8
commit e043549ae4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 29 deletions

View File

@ -1,5 +1,4 @@
# https://github.com/foundry-rs/foundry/blob/master/.github/workflows/release.yml # https://github.com/lightclient-rs/foundry/blob/master/.github/workflows/release.yml
name: Release version name: Release version
on: on:
@ -7,6 +6,7 @@ on:
env: env:
IS_NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} IS_NIGHTLY: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
CARGO_TERM_COLOR: always
jobs: jobs:
prepare: prepare:
@ -22,7 +22,6 @@ jobs:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
ref: ${{ env.IS_NIGHTLY && 'stage' || 'main' }}
fetch-depth: 0 fetch-depth: 0
- name: Compute release name and tag - name: Compute release name and tag
@ -90,23 +89,16 @@ jobs:
target: aarch64-apple-darwin target: aarch64-apple-darwin
arch: arm64 arch: arm64
svm_target_platform: macosx-aarch64 svm_target_platform: macosx-aarch64
#- os: windows-latest
# platform: win32
# target: x86_64-pc-windows-msvc
# arch: amd64
# svm_target_platform: macosx-amd64
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v2 uses: actions/checkout@v2
with:
ref: ${{ env.IS_NIGHTLY && 'stage' || 'main' }}
- name: Install toolchain - name: Install toolchain
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
toolchain: stable toolchain: nightly
target: ${{ matrix.job.target }} target: ${{ matrix.job.target }}
override: true override: true
@ -142,18 +134,13 @@ jobs:
VERSION_NAME: ${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }} VERSION_NAME: ${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
run: | run: |
if [ "$PLATFORM_NAME" == "linux" ]; then if [ "$PLATFORM_NAME" == "linux" ]; then
tar -czvf "huff_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release huffc tar -czvf "lightclient_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release lightclient
echo "::set-output name=file_name::huff_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" echo "::set-output name=file_name::lightclient_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz"
elif [ "$PLATFORM_NAME" == "darwin" ]; then elif [ "$PLATFORM_NAME" == "darwin" ]; then
# We need to use gtar here otherwise the archive is corrupt. # We need to use gtar here otherwise the archive is corrupt.
# See: https://github.com/actions/virtual-environments/issues/2619 # See: https://github.com/actions/virtual-environments/issues/2619
gtar -czvf "huff_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release huffc gtar -czvf "lightclient_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release lightclient
echo "::set-output name=file_name::huff_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" echo "::set-output name=file_name::lightclient_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz"
else
cd ./target/${TARGET}/release
7z a -tzip "huff_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" huff.exe
mv "huff_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" ../../../
echo "::set-output name=file_name::huff_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip"
fi fi
shell: bash shell: bash
@ -166,10 +153,10 @@ jobs:
VERSION_NAME: ${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }} VERSION_NAME: ${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
run: | run: |
sudo apt-get -y install help2man sudo apt-get -y install help2man
help2man -N ./target/${TARGET}/release/huffc > huff.1 help2man -N ./target/${TARGET}/release/lightclient > lightclient.1
gzip huff.1 gzip lightclient.1
tar -czvf "huff_man_${VERSION_NAME}.tar.gz" huff.1.gz tar -czvf "lightclient_man_${VERSION_NAME}.tar.gz" lightclient.1.gz
echo "::set-output name=huff_man::huff_man_${VERSION_NAME}.tar.gz" echo "::set-output name=lightclient_man::lightclient_man_${VERSION_NAME}.tar.gz"
shell: bash shell: bash
# Creates the release for this specific version # Creates the release for this specific version
@ -182,9 +169,9 @@ jobs:
body: ${{ needs.prepare.outputs.changelog }} body: ${{ needs.prepare.outputs.changelog }}
files: | files: |
${{ steps.artifacts.outputs.file_name }} ${{ steps.artifacts.outputs.file_name }}
${{ steps.man.outputs.huff_man }} ${{ steps.man.outputs.lightclient_man }}
# If this is a nightly release, it also updates the release # If this is a nightly release, it also updates the release
# tagged `nightly` for compatability with `huffup` # tagged `nightly` for compatability with `lightclientup`
- name: Update nightly release - name: Update nightly release
if: ${{ env.IS_NIGHTLY }} if: ${{ env.IS_NIGHTLY }}
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
@ -195,7 +182,7 @@ jobs:
body: ${{ needs.prepare.outputs.changelog }} body: ${{ needs.prepare.outputs.changelog }}
files: | files: |
${{ steps.artifacts.outputs.file_name }} ${{ steps.artifacts.outputs.file_name }}
${{ steps.man.outputs.huff_man }} ${{ steps.man.outputs.lightclient_man }}
cleanup: cleanup:
name: Release cleanup name: Release cleanup
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -204,8 +191,6 @@ jobs:
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v2 uses: actions/checkout@v2
with:
ref: ${{ env.IS_NIGHTLY && 'stage' || 'main' }}
# Moves the `nightly` tag to `HEAD` # Moves the `nightly` tag to `HEAD`
- name: Move nightly tag - name: Move nightly tag