Skip to content

Commit

Permalink
Revert "single tag"
Browse files Browse the repository at this point in the history
This reverts commit e491d2b.
  • Loading branch information
Smallsan committed Feb 26, 2024
1 parent 36242c7 commit 0e404f0
Showing 1 changed file with 24 additions and 30 deletions.
54 changes: 24 additions & 30 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}"

0 comments on commit 0e404f0

Please sign in to comment.