-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed2c456
commit f1077ad
Showing
4 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: ⚙️ Build Binaries | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
env: | ||
APP_NAME: yartsu | ||
RELEASE_FILES: README.md | ||
|
||
jobs: | ||
build-artifact: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macOS-latest | ||
# - windows-latest # broken | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install Pyoxidizer | ||
run: pip install pyoxidizer | ||
|
||
- name: Build Binary | ||
run: pyoxidizer build --release | ||
|
||
- name: Create Artifact | ||
shell: bash | ||
run: | | ||
assets="${{ env.APP_NAME }}_$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')" | ||
echo "$assets" | ||
mkdir -p "dist/$assets" | ||
cp -r build/**/release/install/${{ env.APP_NAME }}/* "dist/$assets/" | ||
cp -r ${{ env.RELEASE_FILES }} "dist/$assets/" | ||
( | ||
cd dist | ||
if [[ "${{ runner.os }}" == Windows ]]; then | ||
7z a "$assets.zip" "$assets" | ||
else | ||
tar czf "$assets.tar.gz" "$assets" | ||
fi | ||
ls -lah *.* | ||
) | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifact-${{ matrix.os }} | ||
path: | | ||
dist/*.tar.gz | ||
dist/*.zip | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: 🌙 Nightly Release | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 2 * * *' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
check-commits: | ||
uses: daylinmorgan/actions/.github/workflows/check-commits.yml@main | ||
with: | ||
since: "24 hours" | ||
|
||
build-artifacts: | ||
needs: check-commits | ||
if: ${{ needs.check-commits.outputs.quit != 'true' }} | ||
uses: .github/workflows/build.yml | ||
|
||
generate-release: | ||
needs: build-artifacts | ||
uses: daylinmorgan/actions/.github/workflows/nightly.yml@main |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Build and Publish to PyPI | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-n-publish: | ||
name: Build and publish Python 🐍 distributions 📦 to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install pypa/build | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: >- | ||
python -m | ||
build | ||
--sdist | ||
--wheel | ||
--outdir dist/ | ||
. | ||
- name: Publish a Python distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: 🚀 Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
app-name: yartsu | ||
|
||
jobs: | ||
build-artifacts: | ||
uses: ./.github/workflows/build.yml | ||
|
||
pypi-release: | ||
uses: ./.github/workflows/pypi.yml | ||
|
||
create-release: | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build-artifacts | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Download Build Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: dist/ | ||
|
||
- run: ls -R dist/ | ||
|
||
- name: Generate New Nightly Release | ||
run: | | ||
gh release create ${{ github.ref }} ./dist/*/${{ env.app-name }}* | ||