Update secret token in build-release.yml #32
Workflow file for this run
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 workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Release plugin | |
on: | |
pull_request: | |
branches: | |
- "main" | |
- "patch*" | |
types: | |
- closed | |
# push: | |
# branches: [ "main" ] | |
env: | |
PYTHON_VERSION: '3.11.5' | |
PATH_TO_CONFIG: 'src.s3_platform_plugin_template.config' | |
CONFIG_FILE: 'config.json' | |
permissions: | |
contents: write | |
jobs: | |
generate-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install s3p-sdk | |
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: build config | |
run: | | |
python -c "import json; from ${{env.PATH_TO_CONFIG}} import config; print(json.dumps(config.dict()))" > ${{env.CONFIG_FILE}} | |
- name: Get current date for tag | |
id: get_date | |
run: echo "::set-output name=TAG_NAME::v$(date +'%Y%m%d%H%M%S')" | |
- name: Create Tag | |
run: | | |
git tag ${{ steps.get_date.outputs.TAG_NAME }} | |
git push origin ${{ steps.get_date.outputs.TAG_NAME }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PLUGIN_RELEASE_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_date.outputs.TAG_NAME }} | |
release_name: Release ${{ steps.get_date.outputs.TAG_NAME }} | |
body: | | |
Autogenerated release ${{ steps.get_date.outputs.TAG_NAME }} | |
- Config file was generated | |
draft: false | |
prerelease: false | |
- name: Upload config.json to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PLUGIN_RELEASE_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./${{env.CONFIG_FILE}} | |
asset_name: ${{env.CONFIG_FILE}} | |
asset_content_type: application/json | |
- name: Upload config.json to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PLUGIN_RELEASE_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: './plugin.xml' | |
asset_name: 'plugin.xml' | |
asset_content_type: application/json |