-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated dependencies to latest (#63)
- Updated test file to follow the latest pattern - Updated github actions to use the latest version - Updated dependencies to latest version - Implemented eng-automation/js-style deployed library - Before we were using the git hash - Updated version to 0.3.2 - Updated publish script - It's the same as in [auto-merge-bot](https://github.com/paritytech/auto-merge-bot/blob/main/.github/workflows/release.yml)
- Loading branch information
Showing
18 changed files
with
2,059 additions
and
1,096 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
dist | ||
.git |
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,7 +1,16 @@ | ||
const { getConfiguration } = require("opstooling-js-style/src/eslint/configuration"); | ||
|
||
const tsConfParams = { rootDir: __dirname }; | ||
|
||
const conf = getConfiguration({ typescript: tsConfParams }); | ||
|
||
module.exports = conf; | ||
const { | ||
getConfiguration, | ||
getTypescriptOverride, | ||
} = require("@eng-automation/js-style/src/eslint/configuration"); | ||
|
||
const tsConfParams = { rootDir: __dirname }; | ||
|
||
const conf = getConfiguration({ typescript: tsConfParams }); | ||
|
||
const tsConfOverride = getTypescriptOverride(tsConfParams); | ||
conf.overrides.push({ | ||
...tsConfOverride, | ||
rules: { "@typescript-eslint/strict-boolean-expressions": 0 }, | ||
}); | ||
|
||
module.exports = conf; |
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
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,21 +1,39 @@ | ||
name: Continuous testing | ||
|
||
on: [pull_request] | ||
on: | ||
pull_request: | ||
push: | ||
branches: ["master"] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
command: [lint, build, test] | ||
runs-on: ubuntu-latest | ||
name: running ${{ matrix.command }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use node 18 | ||
uses: actions/setup-node@v3 | ||
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 18 | ||
node-version: 20 | ||
- name: Cache node modules | ||
id: cache-npm | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}- | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Run tests | ||
run: yarn test | ||
- name: Run lint | ||
run: yarn lint | ||
- name: Build the project | ||
run: yarn build | ||
- run: yarn run ${{ matrix.command }} | ||
|
||
conclude: | ||
runs-on: ubuntu-latest | ||
name: All tests passed | ||
needs: [test] | ||
steps: | ||
- run: echo '### Good job! All the tests passed 🚀' >> $GITHUB_STEP_SUMMARY |
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 |
---|---|---|
|
@@ -7,109 +7,70 @@ on: | |
|
||
env: | ||
IMAGE_NAME: action | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
test-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3.3.0 | ||
- uses: actions/checkout@v4.1.1 | ||
- name: Check that the image builds | ||
run: docker build . --file Dockerfile | ||
|
||
test-versions: | ||
compare-versions: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.verification.outputs.VERSION }} | ||
exists: ${{ steps.checkTag.outputs.exists }} | ||
steps: | ||
- uses: actions/checkout@v3.3.0 | ||
- uses: actions/checkout@v4.1.1 | ||
- name: Extract package.json version | ||
id: package_version | ||
run: echo "VERSION=$(jq '.version' -r package.json)" >> $GITHUB_OUTPUT | ||
- name: Extract action.yml version | ||
uses: mikefarah/yq@master | ||
id: action_image | ||
with: | ||
cmd: yq '.runs.image' 'action.yml' | ||
- name: Parse action.yml version | ||
id: action_version | ||
run: | | ||
echo "IMAGE_VERSION=$(echo $IMAGE_URL | cut -d: -f3)" >> $GITHUB_OUTPUT | ||
env: | ||
IMAGE_URL: ${{ steps.action_image.outputs.result }} | ||
# Compare that the versions contain the same name | ||
- name: Compare versions | ||
run: | | ||
echo "Verifying that $IMAGE_VERSION from action.yml is the same as $PACKAGE_VERSION from package.json" | ||
[[ $IMAGE_VERSION == $PACKAGE_VERSION ]] | ||
env: | ||
IMAGE_VERSION: ${{ steps.action_version.outputs.IMAGE_VERSION }} | ||
PACKAGE_VERSION: ${{ steps.package_version.outputs.VERSION }} | ||
|
||
tag: | ||
if: github.event_name == 'push' | ||
needs: [test-image, test-versions] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
outputs: | ||
tagcreated: ${{ steps.autotag.outputs.tagcreated }} | ||
tagname: ${{ steps.autotag.outputs.tagname }} | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- uses: butlerlogic/action-autotag@stable | ||
id: autotag | ||
id: verification | ||
uses: Bullrich/compare-version-on-action@main | ||
with: | ||
head_branch: master | ||
tag_prefix: "v" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Changelog | ||
uses: Bullrich/[email protected] | ||
id: Changelog | ||
env: | ||
REPO: ${{ github.repository }} | ||
- name: Create Release | ||
if: steps.autotag.outputs.tagname != '' | ||
uses: actions/create-release@latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.autotag.outputs.tagname }} | ||
release_name: Release ${{ steps.autotag.outputs.tagname }} | ||
body: | | ||
${{ steps.Changelog.outputs.changelog }} | ||
version: ${{ steps.package_version.outputs.VERSION }} | ||
# Verifies if there is a tag with that version number | ||
- uses: mukunku/[email protected] | ||
if: steps.verification.outputs.VERSION | ||
id: checkTag | ||
with: | ||
tag: v${{ steps.package_version.outputs.VERSION }} | ||
|
||
publish: | ||
if: github.event_name == 'push' && needs.compare-versions.outputs.exists == 'false' | ||
needs: [test-image, compare-versions] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
needs: [tag] | ||
if: needs.tag.outputs.tagname != '' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build image | ||
run: docker build . --file Dockerfile --tag $IMAGE_NAME | ||
- name: Log into registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin | ||
- name: Push image | ||
run: | | ||
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME | ||
# Change all uppercase to lowercase | ||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
# Strip git ref prefix from version | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
# Strip "v" prefix from tag name | ||
[[ ! -z $TAG ]] && VERSION=$(echo $TAG | sed -e 's/^v//') | ||
# Use Docker `latest` tag convention | ||
[ "$VERSION" == "main" ] && VERSION=latest | ||
echo IMAGE_ID=$IMAGE_ID | ||
echo VERSION=$VERSION | ||
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION | ||
docker push $IMAGE_ID:$VERSION | ||
- uses: actions/[email protected] | ||
- name: Tag version and create release | ||
run: gh release create $VERSION --generate-notes | ||
env: | ||
TAG: ${{ needs.tag.outputs.tagname }} | ||
VERSION: v${{ needs.compare-versions.outputs.version }} | ||
GH_TOKEN: ${{ github.token }} | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }} | ||
tags: ${{ needs.compare-versions.outputs.version }} | ||
- uses: actions/checkout@v3 | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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,6 +1,6 @@ | ||
{ | ||
"name": "github-issue-sync", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Synchronize issues to GitHub Project boards", | ||
"author": "Parity <[email protected]> (https://parity.io)", | ||
"repository": { | ||
|
@@ -22,18 +22,18 @@ | |
"lint": "yarn eslint && yarn prettier" | ||
}, | ||
"dependencies": { | ||
"@actions/core": "^1.10.0", | ||
"@actions/github": "^5.1.1", | ||
"@octokit/rest": "^19.0.5" | ||
"@actions/core": "^1.10.1", | ||
"@actions/github": "^6.0.0", | ||
"@octokit/rest": "^20.0.2" | ||
}, | ||
"devDependencies": { | ||
"@octokit/graphql-schema": "^12.41.1", | ||
"@types/jest": "^29.2.6", | ||
"@vercel/ncc": "^0.36.1", | ||
"jest": "^29.3.1", | ||
"jest-mock-extended": "^3.0.1", | ||
"opstooling-js-style": "https://github.com/paritytech/opstooling-js-style#c298d0f732d93712e4397fd53baa3317a3022c8c", | ||
"ts-jest": "^29.0.5", | ||
"typescript": "^4.9.4" | ||
"@eng-automation/js-style": "^2.3.0", | ||
"@octokit/graphql-schema": "^14.58.0", | ||
"@types/jest": "^29.5.12", | ||
"@vercel/ncc": "^0.38.1", | ||
"jest": "^29.7.0", | ||
"jest-mock-extended": "^3.0.5", | ||
"ts-jest": "^29.1.2", | ||
"typescript": "^5.4.2" | ||
} | ||
} |
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.