2024-02-03 12:15:40 +03:00
|
|
|
name: Update, build and release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * *'
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
update_packages:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: archlinux:latest
|
|
|
|
steps:
|
|
|
|
- name: Pacman database update
|
|
|
|
run: pacman -Syy --noconfirm
|
|
|
|
|
|
|
|
- name: Install deps
|
2024-02-04 12:48:49 +03:00
|
|
|
run: pacman -S --noconfirm git jq nix
|
2024-02-03 12:15:40 +03:00
|
|
|
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Check and update current packages
|
|
|
|
run: sh .github/workflows/update_packages.sh
|
|
|
|
|
|
|
|
- name: Retrieve version
|
|
|
|
run: sh .github/workflows/retrieve_version.sh
|
|
|
|
|
|
|
|
- name: Commit and push changes
|
|
|
|
uses: EndBug/add-and-commit@v9.1.4
|
|
|
|
id: commit
|
|
|
|
with:
|
|
|
|
message: "Update packages to ${{ env.release_name }}"
|
|
|
|
add: "."
|
|
|
|
author_name: "GitHub Actions"
|
|
|
|
author_email: "loraner123@gmail.com"
|
2024-02-05 16:18:51 +03:00
|
|
|
- name: Publish AUR package
|
|
|
|
uses: KSXGitHub/github-actions-deploy-aur@v2.7.0
|
|
|
|
with:
|
2024-02-14 14:07:10 +03:00
|
|
|
pkgname: "yandex-music"
|
2024-02-05 16:18:51 +03:00
|
|
|
pkgbuild: "PKGBUILD"
|
|
|
|
updpkgsums: false
|
|
|
|
allow_empty_commits: false
|
|
|
|
commit_username: "cucumber-sp"
|
|
|
|
commit_email: "loraner123@gmail.com"
|
|
|
|
ssh_private_key: "${{ secrets.AUR_SSH_PRIVATE_KEY }}"
|
2024-02-18 18:50:45 +03:00
|
|
|
commit_message: $(git log -1 --pretty=format:"%s")
|
2024-02-05 16:18:51 +03:00
|
|
|
ssh_keyscan_types: "rsa,dsa,ecdsa,ed25519"
|
2024-02-03 12:15:40 +03:00
|
|
|
outputs:
|
|
|
|
new_version: ${{ steps.commit.outputs.commited }}
|
|
|
|
commit_long_sha: ${{ steps.commit.outputs.commit_long_sha }}
|
2024-02-04 12:48:49 +03:00
|
|
|
|
2024-02-03 12:15:40 +03:00
|
|
|
build:
|
|
|
|
needs: update_packages
|
|
|
|
uses: ./.github/workflows/build.yml
|
|
|
|
with:
|
2024-02-09 17:35:17 +03:00
|
|
|
ref: ${{ (needs.update_packages.outputs.commit_long_sha || '') }}
|
2024-02-04 12:48:49 +03:00
|
|
|
|
2024-02-03 12:15:40 +03:00
|
|
|
upload-release:
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
2024-02-09 17:35:17 +03:00
|
|
|
ref: ${{ (needs.build.needs.update_packages.outputs.commit_long_sha || '') }}
|
2024-02-03 12:15:40 +03:00
|
|
|
|
|
|
|
- name: Download artifact
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
merge-multiple: true
|
|
|
|
path: dist
|
|
|
|
|
|
|
|
- name: Retrieve version
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install jq
|
|
|
|
sh ./.github/workflows/retrieve_version.sh
|
2024-02-09 17:35:17 +03:00
|
|
|
|
2024-02-09 21:06:54 +03:00
|
|
|
- name: Get Release Notes HTML
|
|
|
|
run: echo "release_html=$(jq -r --arg version "$VERSION" '.["desktop-release-notes." + $version]' ./dist/release_notes.json)" >> $GITHUB_ENV
|
2024-02-09 17:35:17 +03:00
|
|
|
|
|
|
|
- run: rm -rf dist/release_notes.json
|
2024-02-04 12:48:49 +03:00
|
|
|
|
2024-02-03 12:15:40 +03:00
|
|
|
- name: Tag Repo
|
|
|
|
uses: richardsimko/update-tag@v1
|
|
|
|
with:
|
|
|
|
tag_name: ${{ env.tag_name }}
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Upload files to a GitHub release
|
|
|
|
uses: ncipollo/release-action@v1.13.0
|
|
|
|
with:
|
|
|
|
allowUpdates: true
|
|
|
|
artifacts: dist/*
|
|
|
|
makeLatest: true
|
|
|
|
name: ${{ env.release_name }}
|
|
|
|
replacesArtifacts: true
|
|
|
|
tag: ${{ env.tag_name }}
|
2024-02-09 17:35:17 +03:00
|
|
|
body: ${{ env.release_html }}
|
2024-02-04 12:48:49 +03:00
|
|
|
|