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

upm-config@v1.0.0 #1

Merged
merged 17 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @StephenHodgson
78 changes: 78 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: validate

on:
push:
branches:
- 'main'
pull_request:
branches:
- '*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: ${{ github.ref }}

jobs:
validate:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]

steps:
- name: checkout self
uses: actions/checkout@v4

- name: RageAgainstThePixel/upm-config
uses: ./
with:
registry_url: ${{ secrets.UPM_REGISTRY_URL }}
auth_token: ${{ secrets.UPM_AUTH_TOKEN }}

- run: |
# macOS and Linux '~/.upmconfig.toml'
# windows '%USERPROFILE%\.upmconfig.toml'

if [[ "$OSTYPE" == "msys" ]]; then
upmconfig="$USERPROFILE\\.upmconfig.toml"
else
upmconfig="$HOME/.upmconfig.toml"
fi

if [[ ! -f "$upmconfig" ]]; then
echo ".upmconfig.toml does not exist"
exit 1
fi

chmod +w "$upmconfig"
rm "$upmconfig"
shell: bash

- name: RageAgainstThePixel/upm-config
uses: ./
with:
registry_url: ${{ secrets.UPM_REGISTRY_URL }}
username: ${{ secrets.UPM_USERNAME }}
password: ${{ secrets.UPM_PASSWORD }}

- run: |
# macOS and Linux '~/.upmconfig.toml'
# windows '%USERPROFILE%\.upmconfig.toml'

if [[ "$OSTYPE" == "msys" ]]; then
upmconfig="$USERPROFILE\\.upmconfig.toml"
else
upmconfig="$HOME/.upmconfig.toml"
fi

if [[ ! -f "$upmconfig" ]]; then
echo ".upmconfig.toml does not exist"
exit 1
fi

chmod +w "$upmconfig"
rm "$upmconfig"
shell: bash
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 RageAgainstThePixel
Copyright (c) 2024 Rage Against The Pixel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# upm-config
A GitHub action for setting Unity UPM private scoped registry configurations.

A GitHub action for setting Unity UPM private scoped registry credentials.

## How to use

### workflow

```yaml
steps:
- uses: RageAgainstThePixel/upm-config@v1
with:
registry_url: 'http://upm.registry.com:4873'
username: ${{ secrets.UPM_USERNAME }}
password: ${{ secrets.UPM_PASSWORD }}

```

### inputs

| name | description | required |
| ---- | ----------- | -------- |
| registry_url | The URL of the private scoped registry. | true |
| auth_token | The authentication token for the private scoped registry. | Required if username and password are not provided. |
| username | The username for the private scoped registry. | Required if auth_token is not provided. |
| password | The password for the private scoped registry. | Required if auth_token is not provided. |
| always_auth | Whether to always authenticate with the private scoped registry. Defaults to true. | false |
24 changes: 24 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'upm-config'
description: 'A GitHub action for setting Unity UPM private scoped registry configurations.'

inputs:
registry_url:
description: 'The URL of the private scoped registry.'
required: true
auth_token:
description: 'The authentication token for the private scoped registry. Required if username and password are not provided.'
required: false
username:
description: 'The username for the private scoped registry. Required if auth_token is not provided.'
required: false
password:
description: 'The password for the private scoped registry. Required if auth_token is not provided.'
required: false
always_auth:
description: 'Whether to always authenticate with the private scoped registry. Defaults to true.'
required: false
default: 'true'

runs:
using: 'node20'
main: 'dist/index.js'
Loading