-
-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update version in package.json on commit
- Loading branch information
Showing
6 changed files
with
36 additions
and
1,105 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,13 @@ name: Build | |
|
||
on: | ||
push: | ||
branches: [ master ] | ||
tags: [ 'v*' ] | ||
paths-ignore: ['**.md', 'docs/**'] | ||
branches: [master] | ||
tags: ["v*"] | ||
paths-ignore: ["**.md", "docs/**"] | ||
|
||
pull_request: | ||
branches: [ master ] | ||
paths-ignore: ['**.md', 'docs/**'] | ||
branches: [master] | ||
paths-ignore: ["**.md", "docs/**"] | ||
|
||
jobs: | ||
linter: | ||
|
@@ -21,59 +21,59 @@ jobs: | |
with: | ||
version: v1.37 | ||
args: --timeout=10m | ||
|
||
releaser: | ||
needs: linter | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.3.4 | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Snapcraft | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.16' | ||
go-version: "1.16" | ||
|
||
- name: Cache Go modules | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Run Postgres Tests | ||
run: go test -v ./... | ||
|
||
- name: Run MySQL Tests | ||
working-directory: ./core | ||
run: | | ||
go test -v -db=mysql -run=Example_query | ||
go test -v -db=mysql -run=Example_sub | ||
- name: Snapcraft Login | ||
if: success() && startsWith(github.ref, 'refs/tags/v') | ||
env: | ||
SNAPCRAFT_CREDS: ${{ secrets.SNAPCRAFT_LOGIN }} | ||
run: | | ||
snapcraft login --with <(echo "$SNAPCRAFT_CREDS") | ||
- name: Import GPG key | ||
if: success() && startsWith(github.ref, 'refs/tags/v') | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@v3 | ||
with: | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
|
||
- name: Run GoReleaser | ||
if: success() && startsWith(github.ref, 'refs/tags/v') | ||
uses: goreleaser/goreleaser-action@v2 | ||
|
@@ -84,3 +84,18 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GR_TOKEN }} | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | ||
|
||
report: | ||
needs: releaser | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Update version in package.json | ||
run: | | ||
apt-get install jq | ||
jq '.version = $newVal' --arg newVal '${GITHUB_REF/refs\/tags\//}' package.json > tmp.$$.json && mv tmp.$$.json package.json | ||
- name: Commit updated package.json | ||
run: | | ||
git config --global user.email '[email protected]' | ||
git commit -am "Updating version in package.json to ${GITHUB_REF/refs\/tags\//}" | ||
git push |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,4 +43,6 @@ release | |
.idea | ||
node_modules | ||
bin | ||
./package-lock.json | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.idea | ||
node_modules | ||
**/* |
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
Oops, something went wrong.