Beta Release #273
This file contains hidden or 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: Beta Release | |
| on: | |
| schedule: | |
| - cron: "0 12 */3 * *" | |
| jobs: | |
| json-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: '14' | |
| - name: Install jsonlint | |
| run: npm install -g jsonlint | |
| - name: Run JSON lint | |
| run: | | |
| #!/bin/bash | |
| set -e | |
| error_found=false | |
| while IFS= read -r -d '' file | |
| do | |
| if ! jsonlint -q "$file"; then | |
| echo "Error in file: $file" | |
| jsonlint "$file" | |
| error_found=true | |
| fi | |
| done < <(find . -name "*.json" -type f -print0) | |
| if [ "$error_found" = true ] ; then | |
| echo "JSON linting failed" | |
| exit 1 | |
| fi | |
| beta-release: | |
| needs: json-lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Create zip archive | |
| run: | | |
| zip -r repo.zip . | |
| - name: Create tag | |
| id: create_tag | |
| run: | | |
| git config --global user.email "actions@github.com" | |
| git config --global user.name "GitHub Actions" | |
| git tag -a beta-$(date +%Y%m%d%H%M%S) -m "Beta release" | |
| git push origin beta-$(date +%Y%m%d%H%M%S) | |
| echo "::set-output name=tag_name::beta-$(date +%Y%m%d%H%M%S)" | |
| - name: Create release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.create_tag.outputs.tag_name }} | |
| release_name: Beta Release ${{ steps.create_tag.outputs.tag_name }} | |
| body: | | |
| This is a beta release of the AC Overlay. | |
| draft: false | |
| prerelease: true | |
| - name: Upload release asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./repo.zip | |
| asset_name: ACRP-preview.zip | |
| asset_content_type: application/zip |