mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
misc: Automated releases generation (#1806)
* misc: Automated releases generation * Update cd.yml
This commit is contained in:
parent
425e2e87d5
commit
bc74550294
1 changed files with 35 additions and 6 deletions
41
.github/workflows/cd.yml
vendored
41
.github/workflows/cd.yml
vendored
|
@ -79,17 +79,46 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
|
||||||
|
- name: Set the release version
|
||||||
|
shell: bash
|
||||||
|
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.1'
|
||||||
|
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
|
||||||
|
- name: Create archive
|
||||||
|
id: create_zip
|
||||||
|
run: |
|
||||||
|
ZIP_NAME="torrentpier-${{ env.RELEASE_VERSION }}.zip"
|
||||||
|
zip -r "$ZIP_NAME" . -x ".git/*" ".github/*"
|
||||||
|
echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Publish to GitHub
|
||||||
if: ${{ !contains(github.ref, '-') }}
|
if: ${{ !contains(github.ref, '-') }}
|
||||||
run: cargo build --release
|
|
||||||
- name: Upload binaries to release
|
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
with:
|
with:
|
||||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
file: target/release/mything
|
file: ${{ steps.create_zip.outputs.ZIP_NAME }}
|
||||||
asset_name: mything
|
|
||||||
file_glob: true
|
file_glob: true
|
||||||
overwrite: true
|
overwrite: true
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
release_name: "TorrentPier v${{ github.ref }}"
|
release_name: "TorrentPier v${{ env.RELEASE_VERSION }}"
|
||||||
|
body: "${{ needs.generate-changelog.outputs.release_body }}"
|
||||||
|
|
||||||
|
- name: Publish to GitHub (pre-release)
|
||||||
|
if: ${{ contains(github.ref, '-') }}
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
file: ${{ steps.create_zip.outputs.ZIP_NAME }}
|
||||||
|
file_glob: true
|
||||||
|
overwrite: true
|
||||||
|
tag: ${{ github.ref }}
|
||||||
|
release_name: "TorrentPier v${{ env.RELEASE_VERSION }}"
|
||||||
body: "${{ needs.generate-changelog.outputs.release_body }}"
|
body: "${{ needs.generate-changelog.outputs.release_body }}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue