mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -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:
|
||||
- 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, '-') }}
|
||||
run: cargo build --release
|
||||
- name: Upload binaries to release
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: target/release/mything
|
||||
asset_name: mything
|
||||
file: ${{ steps.create_zip.outputs.ZIP_NAME }}
|
||||
file_glob: true
|
||||
overwrite: true
|
||||
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 }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue