Skip to content

Commit

Permalink
added wrokflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhichang committed Dec 25, 2023
1 parent 5ce0888 commit 6b2b35f
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Nightly Build

on:
schedule:
- cron: '0,10,20,30,40,50 * * * *' # This schedule runs every night at midnight UTC

jobs:
nightly:
runs-on: ubuntu-latest
steps:
- name: Ensure workspace ownership
run: echo "chown -R $USER $GITHUB_WORKSPACE" && sudo chown -R $USER $GITHUB_WORKSPACE

- name: Check out code
uses: actions/checkout@v3

- name: Prepare release body
run: |
RELEASE_DATETIME=$(date --rfc-3339=seconds)
cat <<EOF > release_template.md
Release created at $RELEASE_DATETIME
EOF
envsubst < release_template.md > release_body.md
- name: Build source tarball
run: git archive --format=tar HEAD | gzip > archive.tgz

- name: Create or overwrite a releae
# https://github.com/actions/upload-release-asset has been replaced by https://github.com/softprops/action-gh-release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.MY_GITHUB_TOKEN }} # Use the secret as an environment variable
prerelease: true
tag_name: nightly
# The body field does not support environment variable substitution directly.
body_path: release_body.md
files: |
*.tgz
18 changes: 18 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: tests

on:
push:
branches: [ master ]
pull_request:
types: [ opened, synchronize, reopened, edited ]

jobs:
tests:
name: tests
runs-on: ubuntu-latest
steps:
- name: Ensure workspace ownership
run: echo "chown -R $USER $GITHUB_WORKSPACE" && sudo chown -R $USER $GITHUB_WORKSPACE

- name: Check out code
uses: actions/checkout@v3

0 comments on commit 6b2b35f

Please sign in to comment.