Automated update #3447
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Automated update" | |
on: | |
schedule: | |
- cron: '0 */6 * * *' | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@main | |
with: | |
ref: master | |
- name: Install nix | |
uses: cachix/install-nix-action@master | |
with: | |
extra_nix_config: | | |
experimental-features = nix-command flakes | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Setup cachix | |
uses: cachix/cachix-action@master | |
with: | |
name: linyinfeng | |
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | |
- name: Cache | |
uses: actions/cache@main | |
with: | |
path: | | |
pkgs/_sources/.shake.database | |
key: ${{ runner.os }}-${{ hashFiles('pkgs/dev-packages/nvfetcher-self/src/*') }}-${{ hashFiles('pkgs/_sources/generated.nix') }} | |
restore-keys: | | |
${{ runner.os }}-${{ hashFiles('pkgs/dev-packages/nvfetcher-self/src/*') }}- | |
- name: Git config | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Setup nvchecker key file | |
run: | | |
cat > keyfile.toml <<EOF | |
[keys] | |
github = "${{ secrets.GITHUB_TOKEN }}" | |
httptoken_clash-premium-aarch64-linux = "Bearer ${{ secrets.GITHUB_TOKEN }}" | |
httptoken_clash-premium-i686-linux = "Bearer ${{ secrets.GITHUB_TOKEN }}" | |
httptoken_clash-premium-x86_64-darwin = "Bearer ${{ secrets.GITHUB_TOKEN }}" | |
httptoken_clash-premium-x86_64-linux = "Bearer ${{ secrets.GITHUB_TOKEN }}" | |
EOF | |
- name: Run update | |
run: | | |
# update and set variables | |
# - CHANGELOG | |
nix run .#devPackages/update | |
- name: Create pull request | |
if: ${{ env.CHANGELOG != '' }} | |
uses: peter-evans/create-pull-request@main | |
id: cpr | |
with: | |
token: '${{ secrets.PAT_FOR_CREATE_PULL_REQUEST }}' | |
title: Automated update | |
body: | | |
###### Changelog | |
```text | |
${{ env.CHANGELOG }} | |
``` | |
branch: 'create-pull-request/update' | |
assignees: | | |
linyinfeng | |
reviewers: | | |
linyinfeng | |
labels: | | |
auto merge | |
auto update | |
delete-branch: true |