Skip to content

Commit

Permalink
feat: add nightly workflow for automated release management
Browse files Browse the repository at this point in the history
  • Loading branch information
HsiangNianian committed Jan 12, 2025
1 parent 1063a54 commit d75c998
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: nightly
permissions:
contents: write
on:
schedule:
- cron: '0 10 * * *'
push:
paths:
- '.github/workflows/nightly.yml'
jobs:
init:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
const releases = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo,
});
for (const release of releases.data) {
if (release.tag_name === 'nightly') {
await github.rest.repos.deleteRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.id,
});
}
}
try {
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `tags/nightly`,
});
} catch (error) {}
nightly:
needs: init
strategy:
matrix:
platform:
- runner: ubuntu-latest
os: ubuntu-latest
- runner: windows-latest
os: windows-latest
- runner: macos-latest
os: macos-latest
runs-on: ${{ matrix.platform.runner }}
steps:
- uses: actions/checkout@v4
- uses: actboy168/action-zip@main
id: zip
with:
name: swi-prolog-docs-${{ matrix.platform.runner }}-${{ github.sha }}
path: |
src/*
README.rst
COPYING
- uses: softprops/action-gh-release@v1
with:
name: nightly
tag_name: nightly
fail_on_unmatched_files: true
files: ${{ steps.zip.outputs.output }}

0 comments on commit d75c998

Please sign in to comment.