publish package #74
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 package | |
on: | |
push: | |
branches: | |
- main | |
schedule: # midnight nightly | |
- cron: '0 0 * * *' | |
workflow_dispatch: {} # allow manual triggering | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Refresh PSL | |
run: | # get the latest public suffix list and write to file | |
make refresh-psl-curl | |
shell: bash | |
- name: Configure Git | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
- name: Add deployment key | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.DEPLOY_KEY_PRIVKEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
shell: bash | |
- name: Commit and push | |
run: | | |
if git diff --quiet; then | |
echo "No changes to commit" | |
else | |
git add . | |
git commit -m "Update PSL" | |
git push | |
fi | |
shell: bash | |
- name: Get the date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y%m%d')" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: 0.1.${{ steps.date.outputs.date }} | |
release_name: Release 0.1.${{ steps.date.outputs.date }} | |
draft: false | |
prerelease: false |