Skip to content

Commit

Permalink
cont.
Browse files Browse the repository at this point in the history
  • Loading branch information
Leechael committed Oct 17, 2024
1 parent 2f06fa5 commit 2f72fa1
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ on:
default: false

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: rust
package-name: your-package-name

build:
name: Build and Test
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -71,24 +83,19 @@ jobs:
cargo --version
rustc --version
create-release:
needs: build
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-build
path: target/release/*

upload-release-assets:
needs: [release-please, build]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
if: ${{ needs.release-please.outputs.release_created }}
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Download all artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v2

- name: Calculate MD5 checksums
run: |
Expand All @@ -97,21 +104,10 @@ jobs:
done
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./checksums.md5
asset_name: checksums.md5
asset_content_type: text/plain

- name: Upload Binaries to Release
uses: AButler/upload-release-assets@v2.0
with:
files: '*-build/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.ref }}
run: |
gh release upload ${{ needs.release-please.outputs.tag_name }} checksums.md5 *-build/* --clobber
- name: Debug log
if: ${{ github.event.inputs.debug_enabled == 'true' }}
Expand Down

0 comments on commit 2f72fa1

Please sign in to comment.