Skip to content

Create ketch.eno (#416) #251

Create ketch.eno (#416)

Create ketch.eno (#416) #251

Workflow file for this run

on:
push:
branches:
- main
name: Create Release
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: set env
run: echo "TAG_NAME=$(date +'%Y%m%d%H%M')" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v2
- name: asdf_install
uses: asdf-vm/actions/install@v1
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install
run: npm ci
env:
AWS_DEFAULT_REGION: us-east-1
- name: Build
run: npm run build
- name: NPM package version bump
run: npm version patch --no-git-tag-version
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "NPM package version bump"
- name: Publish to npm
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.TAG_NAME }}
release_name: ${{ env.TAG_NAME }}
body: Ghostery Tracker DB release for ${{ env.TAG_NAME }}
draft: false
prerelease: false
- name: Upload SQL
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/trackerdb.db
asset_name: trackerdb.db
asset_content_type: application/vnd.sqlite3
- name: Upload JSON
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/trackerdb.json
asset_name: trackerdb.json
asset_content_type: application/json
- name: Upload Engine
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/trackerdb.engine
asset_name: trackerdb.engine
asset_content_type: application/octet-stream
- name: Upload TXT
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/trackerdb.txt
asset_name: trackerdb.txt
asset_content_type: text/plain