simplify template pipeline
Update void-packages template / Update xbps-src template (push) Has been cancelled Details

This commit is contained in:
Luca Bilke 2024-05-22 18:45:23 +02:00
parent 9464f35779
commit 065e2b63e7
No known key found for this signature in database
GPG Key ID: B753481DA0B6FA47
2 changed files with 35 additions and 70 deletions

View File

@ -1,70 +0,0 @@
name: Tag and release
on:
push:
branches:
- main
paths-ignore:
- ".**"
jobs:
release:
name: Set tag and create release
runs-on: ubuntu-latest
outputs:
sha256: ${{ steps.archive.outputs.sha256 }}
version: ${{ steps.tag.outputs.tag }}
permissions:
contents: write
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Bump version and push tag
id: tag
uses: https://github.com/mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.FORGEJO_PUSH_TOKEN }}
tag_prefix: ""
- name: Create release archive
id: archive
run: |
mkdir -p ../dist
cp -R * ../dist
mv ../dist ./
echo "sha256=$(sha256sum dwm.tar.gz) >> $GITHUB_OUTPUT"
- name: Create release
uses: https://code.forgejo.org/actions/forgejo-release@v1
with:
tag: ${{ steps.tag.outputs.new_tag }}
direction: upload
url: https://git.snaile.de
release-dir: ./
update-template:
name: Update xbps-src template
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.FORGEJO_PUSH_TOKEN }}
repository: "https://git.snaile.de/snailed/void-packages"
- name: Replace checksum and version
run: |
sed -i 's/version=[0-9]\+\.[0-9]\+\.[0-9]\+/version=${{ needs.release.outputs.version }}/' srcpkgs/dwm-custom/template
sed -i 's/checksum=.\+/checksum=${{ needs.release.outputs.sha256 }}/' srcpkgs/dwm-custom/template
- name: Commit
uses: https://github.com/stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # v4.16.0
with:
commit_user_name: "Johnny5"
commit_user_email: "bot@snaile.de"
commit_author: "Johnny5 <bot@snaile.de>"
commit_message: "dwm-custom: update to ${{ needs.release.outputs.version }}."

View File

@ -0,0 +1,35 @@
name: Update void-packages template
on:
push:
tags: ["*"]
jobs:
update-template:
name: Update xbps-src template
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.FORGEJO_PUSH_TOKEN }}
repository: "https://git.snaile.de/snailed/void-packages"
- name: Get checksum
id: checksum
run: |
echo "sha256sum=$(curl -s https://git.snaile.de/snailed/dwm-custom/archive/${{ github.ref }}.tar.gz | sha256sum | cut -d ' ' -f 1)" >>$GITHUB_OUTPUT
- name: Replace checksum and version
run: |
sed -i 's/version=[0-9]\+\.[0-9]\+\.[0-9]\+/version=${{ github.ref }}/' srcpkgs/dwm-custom/template
sed -i 's/checksum=.\+/checksum=${{ steps.checksum.outputs.sha256 }}/' srcpkgs/dwm-custom/template
- name: Commit
uses: https://github.com/stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # v4.16.0
with:
commit_user_name: "Johnny5"
commit_user_email: "bot@snaile.de"
commit_author: "Johnny5 <bot@snaile.de>"
commit_message: "dwm-custom: update to ${{ github.ref }}."