mirror of
https://github.com/RubyMetric/chsrc.git
synced 2024-11-22 12:05:40 +08:00
use new env variable style
This commit is contained in:
parent
5c2299fb1e
commit
9eeeca23d7
22
.github/workflows/pkg-aur-bin.yml
vendored
22
.github/workflows/pkg-aur-bin.yml
vendored
|
@ -13,24 +13,27 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Get the release tag
|
- name: Get the release tag
|
||||||
id: get_tag
|
id: get_tag
|
||||||
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
|
# run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
|
||||||
|
run: |
|
||||||
|
echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||||
- name: Validate version tag
|
- name: Validate version tag
|
||||||
run: |
|
run: |
|
||||||
if [[ ! ${{ steps.get_tag.outputs.tag }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
if [[ ! $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
echo "Abnormal version tag: ${{ steps.get_tag.outputs.tag }}"
|
echo "Abnormal version tag: $tag""
|
||||||
echo "Exiting..."
|
echo "valid=0" >> $GITHUB_ENV
|
||||||
exit 0
|
|
||||||
else
|
else
|
||||||
tag=$(echo ${{ steps.get_tag.outputs.tag }} | sed 's/^v//')
|
version=$(echo $tag | sed 's/^v//')
|
||||||
echo "version=$tag" >> $GITHUB_ENV
|
echo "version=$version" >> $GITHUB_ENV
|
||||||
|
echo "valid=1" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
- name: Fetch PKGBUILD
|
- name: Fetch PKGBUILD
|
||||||
run: |
|
run: |
|
||||||
wget https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD\?h\=chsrc -O ./PKGBUILD
|
wget https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD\?h\=chsrc -O ./PKGBUILD
|
||||||
- name: Update PKGBUILD
|
- name: Update PKGBUILD
|
||||||
run: |
|
run: |
|
||||||
sed -i "s/pkgver=.*/pkgver=${{ env.version }}/" PKGBUILD
|
sed -i "s/pkgver=.*/pkgver=$version/" PKGBUILD
|
||||||
- name: Publish to AUR
|
- name: Publish to AUR
|
||||||
|
if: env.valid == '1'
|
||||||
uses: KSXGitHub/github-actions-deploy-aur@v3.0.1
|
uses: KSXGitHub/github-actions-deploy-aur@v3.0.1
|
||||||
with:
|
with:
|
||||||
pkgname: chsrc
|
pkgname: chsrc
|
||||||
|
@ -39,5 +42,6 @@ jobs:
|
||||||
test: true # Check that PKGBUILD could be built, and update pkgver
|
test: true # Check that PKGBUILD could be built, and update pkgver
|
||||||
commit_username: ${{ secrets.AUR_USERNAME }}
|
commit_username: ${{ secrets.AUR_USERNAME }}
|
||||||
commit_email: ${{ secrets.AUR_EMAIL }}
|
commit_email: ${{ secrets.AUR_EMAIL }}
|
||||||
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
# ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
||||||
|
ssh_private_key: placeholder
|
||||||
commit_message: github-action-auto-publish
|
commit_message: github-action-auto-publish
|
||||||
|
|
Loading…
Reference in New Issue
Block a user