Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated dependencies to latest #63

Merged
merged 9 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/github-issue-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
uses: tibdex/github-app-token@v2.1.0
with:
app_id: ${{ secrets.PROJECT_APP_ID }}
private_key: ${{ secrets.PROJECT_APP_KEY }}
Expand Down
40 changes: 29 additions & 11 deletions .github/workflows/javascript-test.yml
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/checkout@v4.1.1
- uses: actions/setup-node@v4.0.2
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
129 changes: 45 additions & 84 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/checkout@v3.3.0
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/generate-release-changelog@2.0.2
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/tag-exists-action@v1.4.0
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/checkout@v4.1.1
- 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 }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Because this project is intended to be used with a token we need to do an extra
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
uses: tibdex/github-app-token@v2.1.0
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ inputs:
type: string
runs:
using: 'docker'
image: 'docker://ghcr.io/paritytech/github-issue-sync/action:0.3.1'
image: 'docker://ghcr.io/paritytech/github-issue-sync/action:0.3.2'
24 changes: 12 additions & 12 deletions package.json
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 <admin@parity.io> (https://parity.io)",
"repository": {
Expand All @@ -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"
}
}
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"rootDir": "./src",
"target": "ESNext",
"lib": ["ESNext"],
"moduleResolution": "node",
"module": "NodeNext",
"sourceMap": false,
"declaration": false,
Expand Down
Loading
Loading