Skip to content

Commit

Permalink
Merge branch 'main' into explanation
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
  • Loading branch information
Bullrich committed Oct 18, 2023
2 parents 477e414 + 1b4cf6c commit 5b7e5df
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 5 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Publish package to GitHub Packages
on:
push:
branches:
- main
pull_request:

env:
IMAGE_NAME: action
REGISTRY: ghcr.io

jobs:
test-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.3.0
- name: Check that the image builds
run: docker build . --file Dockerfile

compare-versions:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.verification.outputs.VERSION }}
exists: ${{ steps.checkTag.outputs.exists }}
steps:
- uses: actions/checkout@v3.3.0
- name: Extract package.json version
id: package_version
run: echo "VERSION=$(jq '.version' -r package.json)" >> $GITHUB_OUTPUT
# Compare that the versions contain the same name
- name: Compare versions
id: verification
uses: Bullrich/compare-version-on-action@main
with:
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
steps:
- uses: actions/checkout@v3.3.0
- name: Tag version and create release
run: gh release create $VERSION --generate-notes
env:
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 }}
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,14 @@ Adding the github account to your identity requires the usage of the `additional
![Add github name to the additional fields of the on-chain identity](.github/github-on-chain-identity-process.jpg)

You should also at least add the `display` field. If you want to add `utf8` characters, you need to hex encode them and put the hex string (`0x` prefixed) into the field.

## Deployment

To deploy a new version you need to update two files:
- [`package.json`](./package.json): Update the version number.
- [`action.yml`](./action.yml): Update the image number in `runs.image`.
**Important**: Both versions must have the same number.

When a commit is pushed to the main branch and the versions have changed, the system will automatically tag the commit and release a new package with such version.

You can find all the available versions in the [release section](./releases).
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ outputs:

runs:
using: 'docker'
image: 'Dockerfile'
image: 'docker://ghcr.io/paritytech/get-fellows-action/action:1.0.0'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "get-fellows-action",
"version": "0.0.1",
"version": "1.0.0",
"description": "Fetch all the GitHub handles from the Fellows",
"main": "src/index.ts",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3737,9 +3737,9 @@ postcss-selector-parser@^6.0.11:
util-deprecate "^1.0.2"

postcss@^8.4.28, postcss@^8.4.5:
version "8.4.30"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.30.tgz#0e0648d551a606ef2192a26da4cabafcc09c1aa7"
integrity sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==
version "8.4.31"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d"
integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==
dependencies:
nanoid "^3.3.6"
picocolors "^1.0.0"
Expand Down

0 comments on commit 5b7e5df

Please sign in to comment.