Skip to content
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
36 changes: 18 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,25 @@ jobs:

upload-to-s3:
runs-on: ubuntu-latest
needs: create-github-release # Ensure this runs after the release is created
needs: create-github-release

# Required for OIDC token exchange with AWS
permissions:
id-token: write
contents: read

steps:
- name: Checkout main branch
uses: actions/checkout@v3
with:
ref: main # Checkout the 'main' branch
ref: main

# Install AWS CLI
- name: Install AWS CLI
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --update
aws --version # Verify installation

# Configure AWS credentials
# Configure AWS credentials via IAM Role (OIDC - no static keys needed)
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: ${{ vars.MAPLEgithubaction }}
aws-region: ${{ secrets.AWS_REGION }}


# Minify JavaScript
- name: Minify JavaScript
Expand All @@ -86,16 +82,20 @@ jobs:
# Sync contents to S3 bucket while excluding .github folder
- name: Sync to S3
run: |
aws s3 cp js/ s3://cdn.jemcats.software/MAPLE/${{ github.event.inputs.tag }}/js/ --recursive --exclude "examples/*" --exclude "devs.md"
aws s3 cp assets/dist/ s3://cdn.jemcats.software/MAPLE/${{ github.event.inputs.tag }}/dist/ --recursive
aws s3 cp assets/icons-png s3://cdn.jemcats.software/MAPLE/${{ github.event.inputs.tag }}/assets/ --recursive --exclude "*" --include "*"
aws s3 cp webpage/ s3://jemcats.software/websites/MAPLE/ --recursive
aws s3 cp js/ s3://cdn.jemcats.software/MAPLE/${{ github.event.inputs.tag }}/js/ --recursive --exclude "examples/*" --exclude "devs.md"
aws s3 cp assets/dist/ s3://cdn.jemcats.software/MAPLE/${{ github.event.inputs.tag }}/dist/ --recursive
aws s3 cp assets/icons-png s3://cdn.jemcats.software/MAPLE/${{ github.event.inputs.tag }}/assets/ --recursive --exclude "*" --include "*"
aws s3 cp webpage/ s3://jemcats.software/websites/MAPLE/ --recursive

- name: Clear and Publish Latest to S3
run: |
aws s3 rm s3://cdn.jemcats.software/MAPLE/latest/ --recursive
aws s3 cp s3://cdn.jemcats.software/MAPLE/${{ github.event.inputs.tag }}/ s3://cdn.jemcats.software/MAPLE/latest/ --recursive

- name: Invalidate Latest CDN Tag
run: |
aws cloudfront create-invalidation --distribution-id ${{ vars.cdnjemcatssoftwaredistributionid }} --paths "/MAPLE/latest/*"

publish_npm_package:
runs-on: ubuntu-latest
needs: create-github-release # Ensure this runs after the release is created
Expand Down
1 change: 1 addition & 0 deletions js/MAPLE.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Please add MAPLE-tools.js and MAPLE-helper.js to your HTML file.
// MAPLE.js
// The encoder and decoder for MAPLE
// v2.0.2

MAPLE.encode = function encode(code) {
if (!MAPLE.wordList1.length) return alert("Word lists not loaded yet.");
Expand Down
2 changes: 1 addition & 1 deletion nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jemcats/maple",
"version": "2.0.1",
"version": "2.0.2",
"description": "MAPLE Encoding and Decoding Library",
"main": "index.js",
"repository": {
Expand Down
7 changes: 7 additions & 0 deletions release_descriptions/v2.0.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# v2.0.2

New Features:
- Made publish workflow more secure


**Full Changelog**: https://github.com/JEMcats-Software/MAPLE/compare/v2.0.1...v2.0.2