-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit e491d2b.
- Loading branch information
Showing
1 changed file
with
24 additions
and
30 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 |
---|---|---|
|
@@ -46,27 +46,12 @@ jobs: | |
- name: Build Binary | ||
run: cargo build --verbose --locked --release --target ${{ matrix.target }} | ||
|
||
- name: Upload Binary | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ matrix.name }} | ||
path: target/${{ matrix.target }}/release/${PROJECT_NAME} | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.PAT }} | ||
|
||
- name: Create tag | ||
id: create_tag | ||
shell: pwsh | ||
run: | | ||
# Set the version number to the current date and time | ||
$VERSION="release-$(Get-Date -Format "yyyyMMddHHmmss")" | ||
$VERSION="${{ matrix.name }}-$(Get-Date -Format "yyyyMMddHHmmss")" | ||
echo "::set-output name=version::$VERSION" | ||
# Create the tag | ||
git tag $VERSION | ||
|
@@ -75,7 +60,8 @@ jobs: | |
env: | ||
GIT_COMMITTER_NAME: github-actions | ||
GIT_COMMITTER_EMAIL: [email protected] | ||
|
||
|
||
|
||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
|
@@ -86,18 +72,26 @@ jobs: | |
release_name: Release ${{ steps.create_tag.outputs.version }} | ||
draft: false | ||
prerelease: true | ||
|
||
|
||
- name: Release Binary | ||
shell: bash | ||
run: | | ||
BIN_SUFFIX="" | ||
if [[ "${{ matrix.runner }}" == "windows-latest" ]]; then | ||
BIN_SUFFIX=".exe" | ||
fi | ||
# The built binary output location | ||
BIN_OUTPUT="target/${{ matrix.target }}/release/${PROJECT_NAME}${BIN_SUFFIX}" | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
path: artifacts | ||
# Define a better name for the final binary | ||
BIN_RELEASE="${PROJECT_NAME}-${{ matrix.name }}${BIN_SUFFIX}" | ||
BIN_RELEASE_VERSIONED="${PROJECT_NAME}-${{ github.ref_name }}-${{ matrix.name }}${BIN_SUFFIX}" | ||
|
||
- name: Upload artifacts to release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./artifacts/${{ matrix.name }} | ||
asset_name: ${{ matrix.name }} | ||
asset_content_type: application/octet-stream | ||
# Create the destination directory if it doesn't exist | ||
mkdir -p ./bin | ||
|
||
# Move the built binary where you want it | ||
mv "${BIN_OUTPUT}" "./bin/${BIN_RELEASE}" | ||
|