Skip to content

Commit

Permalink
update. Github Actions Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
blacknon committed Nov 9, 2024
1 parent f8b7f74 commit c2b8bd5
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
shell: bash
run: |
VERSION="$(cargo run --example version)"
echo "::set-output name=version::$VERSION"
echo "name=version::$VERSION" >> $GITHUB_OUTPUT
# https://github.com/actions/cache/blob/master/examples.md#rust---cargo
- name: Cache cargo registry
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
run: |
_TAR=hwatch-${{ steps.package_version.outputs.version }}.${{ matrix.target }}.tar.gz
docker run -i "greymd/tar2rpm:1.0.1" < "$_TAR" > hwatch-${{ steps.package_version.outputs.version }}.${{ matrix.target }}.rpm
echo ::set-output name=sha256::$( sha256sum hwatch-${{ steps.package_version.outputs.version }}.${{ matrix.target }}.rpm | awk '{print $1}' )
echo name=sha256::$( sha256sum hwatch-${{ steps.package_version.outputs.version }}.${{ matrix.target }}.rpm | awk '{print $1}' ) >> $GITHUB_OUTPUT
# use: https://github.com/greymd/tar2package
- name: Build deb
Expand All @@ -129,7 +129,7 @@ jobs:
run: |
_TAR=hwatch-${{ steps.package_version.outputs.version }}.${{ matrix.target }}.tar.gz
docker run -i "greymd/tar2deb:1.0.1" < "$_TAR" > hwatch-${{ steps.package_version.outputs.version }}.${{ matrix.target }}.deb
echo ::set-output name=sha256::$( sha256sum hwatch-${{ steps.package_version.outputs.version }}.${{ matrix.target }}.deb | awk '{print $1}' )
echo name=sha256::$( sha256sum hwatch-${{ steps.package_version.outputs.version }}.${{ matrix.target }}.deb | awk '{print $1}' ) >> $GITHUB_OUTPUT
- name: README for rpm
if: matrix.ext == 'rpm'
Expand Down Expand Up @@ -176,6 +176,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.package_version.outputs.version }}
upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- uses: actions/checkout@v1

Expand All @@ -184,7 +185,7 @@ jobs:
shell: bash
run: |
VERSION="$(cargo run --example version)"
echo "::set-output name=version::$VERSION"
echo "name=version::$VERSION" >> $GITHUB_OUTPUT
- id: create-release
uses: actions/create-release@v1
Expand All @@ -196,13 +197,13 @@ jobs:
draft: true
prerelease: false

- run: |
echo '${{ steps.create-release.outputs.upload_url }}' > release_upload_url.txt
# - run: |
# echo '${{ steps.create-release.outputs.upload_url }}' > release_upload_url.txt

- uses: actions/upload-artifact@v3
with:
name: create-release
path: release_upload_url.txt
# - uses: actions/upload-artifact@v3
# with:
# name: create-release
# path: release_upload_url.txt

upload-release:
strategy:
Expand Down Expand Up @@ -248,7 +249,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.upload-url.outputs.url }}
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./build-${{ matrix.target }}/hwatch-${{ needs.create-release.outputs.version }}.${{ matrix.target }}.${{ matrix.ext }}
asset_name: hwatch-${{ needs.create-release.outputs.version }}.${{ matrix.target }}.${{ matrix.ext }}
asset_content_type: application/octet-stream

0 comments on commit c2b8bd5

Please sign in to comment.