Publish pre-release package #751
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: Publish pre-release package | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
concurrency: | |
group: "pre-release" | |
cancel-in-progress: true | |
jobs: | |
check_date: | |
runs-on: ubuntu-latest | |
name: Check latest commit | |
outputs: | |
should_run: ${{ steps.should_run.outputs.should_run }} | |
steps: | |
- uses: actions/checkout@v2 | |
- id: should_run | |
continue-on-error: true | |
name: check latest commit is less than a day | |
if: ${{ github.event_name == 'schedule' }} | |
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" | |
pre-release: | |
name: "Pre Release" | |
runs-on: "ubuntu-latest" | |
needs: check_date | |
if: ${{ needs.check_date.outputs.should_run != 'false' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Fetch tags | |
run: git fetch --prune --unshallow --tags | |
- name: Update tag | |
uses: richardsimko/update-tag@v1 | |
with: | |
tag_name: latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: pdm-project/setup-pdm@v3 | |
name: Setup PDM | |
with: | |
python-version: '3.10' | |
architecture: x64 | |
version: 2.10.1 | |
prerelease: true | |
enable-pep582: true | |
cache: true | |
cache-dependency-path: '**/pdm.lock' | |
- name: Install dependencies | |
run: pdm install --plugins -d -G ci | |
- name: Build Packages | |
run: pdm build | |
- name: "Build Changelog" | |
id: github_release | |
uses: mikepenz/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
configuration: ".github/release-action-config.json" | |
toTag: ${{ github.ref }} | |
- name: Delete old release assets | |
uses: mknejp/delete-release-assets@v1 | |
with: | |
token: ${{ github.token }} | |
tag: latest | |
assets: 'emote*' | |
- name: Create Release | |
uses: mikepenz/[email protected] #softprops/action-gh-release | |
with: | |
body: ${{ steps.github_release.outputs.changelog }} | |
prerelease: true | |
target_commitish: ${{ github.sha }} | |
tag_name: "latest" | |
name: "Nightly release" | |
files: | | |
dist/* | |
LICENSE-* |