mirror of
https://github.com/cucumber-sp/yandex-music-linux.git
synced 2024-12-23 22:22:59 +03:00
Cleanup CI file
This commit is contained in:
parent
6e4d55670d
commit
363c6e8b71
13
.github/workflows/retrieve_version.sh
vendored
13
.github/workflows/retrieve_version.sh
vendored
@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# get version
|
|
||||||
VERSION=$(jq -r '.ym.version' ./utility/version_info.json)
|
|
||||||
release_name="Beta $VERSION"
|
|
||||||
tag_name="v$VERSION"
|
|
||||||
|
|
||||||
#write variables to github env
|
|
||||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
||||||
echo "release_name=$release_name" >> $GITHUB_ENV
|
|
||||||
echo "tag_name=$tag_name" >> $GITHUB_ENV
|
|
114
.github/workflows/update-build-release.yml
vendored
114
.github/workflows/update-build-release.yml
vendored
@ -15,36 +15,67 @@ jobs:
|
|||||||
container:
|
container:
|
||||||
image: archlinux:latest
|
image: archlinux:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Packages install
|
|
||||||
run: pacman -Syy --noconfirm && pacman -S --noconfirm git jq nix python python-requests
|
- name: Install dependencies
|
||||||
|
run: pacman -Syy --noconfirm && pacman -S --noconfirm git jq nix python python-requests
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Fix git access
|
- name: Git Access Fix
|
||||||
run:
|
run: git config --global --add safe.directory "*"
|
||||||
git config --global --add safe.directory "*"
|
|
||||||
|
|
||||||
- name: Update version file
|
|
||||||
run: python utility/update_version.py
|
|
||||||
|
|
||||||
- name: Update package files
|
- name: Update package files
|
||||||
run: python utility/generate_packages.py
|
run: python utility/update_version.py
|
||||||
|
python utility/generate_packages.py
|
||||||
- name: Retrieve version to make commit
|
|
||||||
run: bash .github/workflows/retrieve_version.sh
|
|
||||||
|
|
||||||
- name: Commit and push changes
|
- name: Commit and push changes
|
||||||
uses: EndBug/add-and-commit@v9.1.4
|
uses: EndBug/add-and-commit@v9.1.4
|
||||||
id: commit
|
id: commit
|
||||||
with:
|
with:
|
||||||
message: "Update packages to ${{ env.release_name }}"
|
message: Update packages
|
||||||
add: "."
|
add: "."
|
||||||
author_name: "GitHub Actions"
|
author_name: GitHub Actions
|
||||||
author_email: "loraner123@gmail.com"
|
author_email: loraner123@gmail.com"
|
||||||
|
|
||||||
|
- name: Get Version
|
||||||
|
id: version
|
||||||
|
run: VERSION=$(jq -r '.ym.version' ./utility/version_info.json)
|
||||||
|
release_name="Beta $VERSION"
|
||||||
|
tag_name="v$VERSION"
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "release_name=$release_name" >> $GITHUB_OUTPUT
|
||||||
|
echo "tag_name=$tag_name" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
commited: ${{ steps.commit.outputs.commited || github.event.head_commit }}
|
||||||
|
commit_long_sha: ${{ steps.commit.outputs.commit_long_sha || github.event.head_commit.id}}
|
||||||
|
commit_name: ${{ github.event.head_commit.message || 'Update packages' }}
|
||||||
|
tag_name: ${{ steps.version.outputs.tag_name }}
|
||||||
|
release_name: ${{ steps.version.outputs.release_name }}
|
||||||
|
version: ${{ steps.version.outputs.VERSION }}
|
||||||
|
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs: [update_packages]
|
||||||
|
uses: ./.github/workflows/build.yml
|
||||||
|
if: ${{ needs.update_packages.outputs.commited }}
|
||||||
|
with:
|
||||||
|
ref: ${{ needs.update_packages.outputs.commit_long_sha }}
|
||||||
|
|
||||||
|
|
||||||
|
upload-release:
|
||||||
|
needs: [build, update_packages]
|
||||||
|
if: ${{ needs.update_packages.outputs.commited }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ needs.update_packages.outputs.commit_long_sha }}
|
||||||
|
|
||||||
- name: Publish package changes to AUR
|
- name: Publish package changes to AUR
|
||||||
if: "${{ github.event.commits[0] || steps.commit.outputs.commited }}"
|
if: "${{ needs.update_packages.outputs.commited && github.ref_name == 'main' }}"
|
||||||
uses: KSXGitHub/github-actions-deploy-aur@v2.7.0
|
uses: KSXGitHub/github-actions-deploy-aur@v2.7.0
|
||||||
with:
|
with:
|
||||||
pkgname: "yandex-music"
|
pkgname: "yandex-music"
|
||||||
@ -54,60 +85,41 @@ jobs:
|
|||||||
commit_username: "cucumber-sp"
|
commit_username: "cucumber-sp"
|
||||||
commit_email: "loraner123@gmail.com"
|
commit_email: "loraner123@gmail.com"
|
||||||
ssh_private_key: "${{ secrets.AUR_SSH_PRIVATE_KEY }}"
|
ssh_private_key: "${{ secrets.AUR_SSH_PRIVATE_KEY }}"
|
||||||
commit_message: "${{ github.event.commits[0].message || env.release_name }}"
|
commit_message: "${{ needs.update_packages.outputs.commit_name }}"
|
||||||
ssh_keyscan_types: "rsa,dsa,ecdsa,ed25519"
|
ssh_keyscan_types: "rsa,dsa,ecdsa,ed25519"
|
||||||
|
|
||||||
outputs:
|
|
||||||
new_version: ${{ steps.commit.outputs.commited }}
|
|
||||||
commit_long_sha: ${{ steps.commit.outputs.commit_long_sha }}
|
|
||||||
|
|
||||||
build:
|
- name: Download artifact
|
||||||
needs: update_packages
|
uses: actions/download-artifact@v4
|
||||||
uses: ./.github/workflows/build.yml
|
|
||||||
with:
|
|
||||||
ref: ${{ (needs.update_packages.outputs.commit_long_sha || '') }}
|
|
||||||
|
|
||||||
upload-release:
|
|
||||||
needs: [build, update_packages]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ (needs.update_packages.outputs.commit_long_sha || '') }}
|
|
||||||
|
|
||||||
- name: Download artifact
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
path: dist
|
path: dist
|
||||||
|
|
||||||
- name: Retrieve version
|
- name: Install packages
|
||||||
run: |
|
run: sudo apt-get update -y
|
||||||
sudo apt-get update
|
sudo apt-get install jq -y
|
||||||
sudo apt-get install jq
|
|
||||||
bash ./.github/workflows/retrieve_version.sh
|
|
||||||
|
|
||||||
- name: Get Release Notes HTML
|
- name: Get Release Notes HTML
|
||||||
run: echo "release_html=$(jq -r --arg version "$VERSION" '.["desktop-release-notes." + $version]' ./dist/release_notes.json)" >> $GITHUB_ENV
|
id: release_notes
|
||||||
|
run: echo "release_html=$(jq -r --arg version "${{ needs.update_packages.outputs.version }}" '.["desktop-release-notes." + $version]' ./dist/release_notes.json)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- run: rm -rf dist/release_notes.json
|
- run: rm -rf dist/release_notes.json
|
||||||
|
|
||||||
- name: Tag Repo
|
- name: Tag Repo
|
||||||
uses: richardsimko/update-tag@v1
|
uses: richardsimko/update-tag@v1
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ env.tag_name }}
|
tag_name: ${{ needs.update_packages.outputs.tag_name}}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Upload files to a GitHub release
|
- name: Upload files to a GitHub release
|
||||||
uses: ncipollo/release-action@v1.13.0
|
uses: ncipollo/release-action@v1.13.0
|
||||||
|
if: ${{ github.ref_name == 'main' }}
|
||||||
with:
|
with:
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
artifacts: dist/*
|
artifacts: dist/*
|
||||||
makeLatest: true
|
makeLatest: true
|
||||||
name: ${{ env.release_name }}
|
name: ${{ needs.update_packages.outputs.release_name }}
|
||||||
replacesArtifacts: true
|
replacesArtifacts: true
|
||||||
tag: ${{ env.tag_name }}
|
tag: ${{ needs.update_packages.outputs.tag_name }}
|
||||||
body: ${{ env.release_html }}
|
body: ${{ steps.release_notes.outputs.release_html }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user