Refine workflow
parent
dae4f35c40
commit
9e459ff192
|
|
@ -1,36 +1,19 @@
|
||||||
name: Monthly Build
|
name: Weekly Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0 0 12 * *
|
- cron: 0 22 * * FRI
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Pull and Release
|
name: Pull and Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repo
|
- name: Set variables
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: git tag
|
|
||||||
uses: actions/github-script@v2
|
|
||||||
id: tag
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const now = new Date()
|
|
||||||
return `${now.getFullYear()}${(now.getMonth() + 1).toString().padStart(2, '0')}${now.getDate().toString().padStart(2, '0')}`
|
|
||||||
result-encoding: string
|
|
||||||
|
|
||||||
- name: Push Tag
|
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name 'Dreamacro'
|
echo "tag=$(date +%Y%m%d)" >> $GITHUB_ENV
|
||||||
git config --global user.email 'dreamacro@users.noreply.github.com'
|
shell: bash
|
||||||
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
|
|
||||||
git tag ${{steps.tag.outputs.result}}
|
|
||||||
git push origin ${{steps.tag.outputs.result}}
|
|
||||||
|
|
||||||
- name: Download file
|
- name: Download file
|
||||||
env:
|
env:
|
||||||
|
|
@ -46,4 +29,15 @@ jobs:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
files: Country.mmdb
|
files: Country.mmdb
|
||||||
tag_name: ${{steps.tag.outputs.result}}
|
tag_name: ${{ env.tag }}
|
||||||
|
|
||||||
|
- name: Git push assets to "release" branch
|
||||||
|
run: |
|
||||||
|
git init
|
||||||
|
git config --local user.name "actions"
|
||||||
|
git config --local user.email "action@github.com"
|
||||||
|
git checkout -b release
|
||||||
|
git add Country.mmdb
|
||||||
|
git commit -m "${{ env.tag }}"
|
||||||
|
git remote add publish https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
|
||||||
|
git push -f publish release
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue